Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Venjob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hoang Nam Nguyen
Venjob
Commits
2d2646d2
Commit
2d2646d2
authored
Oct 06, 2017
by
Hoang Nam Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'fixed apply_page'
parent
44f4d89b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
app/controllers/applies_controller.rb
+6
-2
app/views/users/_my_jobs.html.erb
+2
-2
No files found.
app/controllers/applies_controller.rb
View file @
2d2646d2
class
AppliesController
<
ApplicationController
before_action
:redirect_to_root
,
unless: :logged_in?
,
only: :create
def
new
@user_apply
=
Apply
.
new
(
session
[
:apply
]
||
{})
end
def
create
return
if
current_user
.
nil?
@user_apply
=
Apply
.
new
(
user_apply_job
)
@user_apply
.
job_id
=
Job
.
find
(
params
[
:id
]).
id
@user_apply
.
user_id
=
@current_user
.
id
if
@user_apply
.
valid?
session
[
:apply
]
=
@user_apply
.
as_json
session
[
:apply
]
=
@user_apply
redirect_to
confirm_apply_path
else
render
'new'
...
...
@@ -30,6 +30,10 @@ class AppliesController < ApplicationController
private
def
redirect_to_root
redirect_to
root_path
end
def
user_apply_job
params
.
require
(
:apply
).
permit
(
:email
,
:name
)
end
...
...
app/views/users/_my_jobs.html.erb
View file @
2d2646d2
...
...
@@ -3,7 +3,7 @@
<div
class=
"search_list titlejob col-md-10"
>
<%=
link_to
apply
.
job
.
job_title
,
job_detail_path
(
apply
.
job
.
id
),
class:
'search_list_jobs_title'
%>
<%
unless
apply
.
job
.
short_description
.
nil
?
%>
<%
if
apply
.
job
.
short_description
.
present
?
%>
<li
class=
"detail_description"
>
<%=
truncate
apply
.
job
.
short_description
,
length:
250
%>
<%=
link_to
'read more'
,
job_detail_path
(
apply
.
job
.
id
)
%>
</li>
...
...
@@ -14,7 +14,7 @@
<li
class=
"detail_description col-md-5"
>
<%=
apply
.
job
.
cities
.
map
(
&
:location
).
join
(
','
)
%>
</li>
<%
unless
apply
.
job
.
salary
.
nil
?
%>
<%
if
apply
.
job
.
salary
.
present
?
%>
<li
class=
" detail_description float-right text-success col-md-5"
>
<%=
apply
.
job
.
salary
%>
</li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment