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
0
Merge Requests
0
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
Nguyen Hoang Mai Phuong
VeNJOB
Commits
33f82662
Commit
33f82662
authored
Aug 09, 2021
by
Nguyen Hoang Mai Phuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply confirm page
parent
0b7a5bba
Pipeline
#1387
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
7 deletions
+15
-7
app/controllers/apply_jobs_controller.rb
+8
-4
app/views/apply_jobs/confirm.html.slim
+5
-2
app/views/apply_jobs/new.html.slim
+1
-0
db/migrate/20210809023303_create_active_storage_tables.active_storage.rb
+0
-0
db/schema.rb
+1
-1
No files found.
app/controllers/apply_jobs_controller.rb
View file @
33f82662
class
ApplyJobsController
<
ApplicationController
def
new
@apply_job
=
ApplyJob
.
new
@apply_job
.
job_id
=
params
[
:job_id
]
end
def
confirm
@apply_job
=
ApplyJob
.
new
(
apply_params
)
@apply_job
.
job_id
=
apply_params
[
:job_id
]
end
def
done
@apply_job
=
ApplyJob
.
new
(
apply_params
)
if
@apply_job
.
save
flash
[
:success
]
=
"Done!"
redirect_to
confirm_url
(
@apply_job
)
@apply_job
.
user_id
=
User
.
find_by
(
id:
1
).
id
@apply_job
.
job_id
=
apply_params
[
:job_id
]
if
@apply_job
.
save!
flash
.
now
[
:success
]
=
'Done hehe!'
else
redirect_to
root_url
end
...
...
@@ -19,6 +23,6 @@ class ApplyJobsController < ApplicationController
private
def
apply_params
params
.
permit
(
:name
,
:email
,
:cv
)
params
.
require
(
:apply_job
).
permit
(
:name
,
:email
,
:cv
)
end
end
app/views/apply_jobs/confirm.html.slim
View file @
33f82662
...
...
@@ -2,11 +2,14 @@ h2.text-center.p-4
|
CONFIRM INFORMATION
.col-md-6.offset-md-3
=
form_with
(
model:
@apply_job
,
url:
'/done'
,
local:
true
)
do
|
f
|
=
f
.
hidden_field
:job_id
,
@apply
.
job_id
=
f
.
label
:name
=
f
.
text_field
:name
,
required:
true
,
placeholder:
"Type name..."
,
class:
'form-control'
=
f
.
text_field
:name
,
required:
true
,
disabled:
true
,
placeholder:
"Type name..."
,
class:
'form-control'
=
f
.
hidden_field
:name
,
required:
true
=
f
.
label
:email
=
f
.
text_field
:email
,
required:
true
,
placeholder:
"Type email..."
,
class:
'form-control'
=
f
.
text_field
:email
,
required:
true
,
disabled:
true
,
placeholder:
"Type email..."
,
class:
'form-control'
=
f
.
hidden_field
:email
,
required:
true
p
=
f
.
label
:cv
,
"CV"
=
f
.
file_field
:cv
,
required:
true
,
accept:
"application/pdf"
...
...
app/views/apply_jobs/new.html.slim
View file @
33f82662
...
...
@@ -3,6 +3,7 @@ h2.text-center.p-4
|
APPLY INFORMATION
.col-md-6.offset-md-3
=
form_with
(
model:
@apply_job
,
url:
'/confirm'
,
local:
true
)
do
|
f
|
=
f
.
hidden_field
:job_id
,
@apply
.
job_id
=
f
.
label
:name
=
f
.
text_field
:name
,
required:
true
,
placeholder:
"Type name..."
,
class:
'form-control'
...
...
db/migrate/2021080
5081352
_create_active_storage_tables.active_storage.rb
→
db/migrate/2021080
9023303
_create_active_storage_tables.active_storage.rb
View file @
33f82662
File moved
db/schema.rb
View file @
33f82662
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2021_08_0
5_151654
)
do
ActiveRecord
::
Schema
.
define
(
version:
2021_08_0
9_023303
)
do
create_table
"active_storage_attachments"
,
charset:
"utf8mb4"
,
collation:
"utf8mb4_0900_ai_ci"
,
force: :cascade
do
|
t
|
t
.
string
"name"
,
null:
false
...
...
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