apply confirm page
-
-
Toggle commit list
-
app/controllers/apply_jobs_controller.rb 0 → 100644
1 class ApplyJobsController < ApplicationController 2 def new 3 @apply_job = ApplyJob.new -
Master
@phuongnhm Chỗ này bữa anh có nói
- Từ
params[:job_id]em nên kiểm tra Job có tồn tại hay không nha? - Nếu không tồn tại nên redirect về root
- Sau này làm chức năng User thì kiểm tra thêm User đã login chưa?
- Từ
-
-
-
app/controllers/apply_jobs_controller.rb 0 → 100644
1 class ApplyJobsController < ApplicationController 2 def new 3 @apply_job = ApplyJob.new 4 @apply_job.job_id = params[:job_id] 5 end 6 7 def confirm 8 @apply_job = ApplyJob.new(apply_params) 9 @apply_job.job_id = apply_params[:job_id] -
Master
- Chỗ này em đã có
job_idtrongapply_paramsrồi. Nên không cần gán lại nha. - Em validate thêm bằng Model ở đây nha.
- Nếu validate fail thì render về new và báo message cho người dùng biết
- Chỗ này em đã có
-
-
-
app/controllers/apply_jobs_controller.rb 0 → 100644
1 class ApplyJobsController < ApplicationController 2 def new 3 @apply_job = ApplyJob.new 4 @apply_job.job_id = params[:job_id] 5 end 6 7 def confirm 8 @apply_job = ApplyJob.new(apply_params) 9 @apply_job.job_id = apply_params[:job_id] 10 end 11 12 def done 13 @apply_job = ApplyJob.new(apply_params) 14 @apply_job.user_id = User.find_by(id: 1).id 15 @apply_job.job_id = apply_params[:job_id] -
Master
- Chỗ này em đã có
job_idtrongapply_paramsrồi. Nên không cần gán lại nha.
- Chỗ này em đã có
-
-
-
app/controllers/apply_jobs_controller.rb 0 → 100644
1 class ApplyJobsController < ApplicationController 2 def new 3 @apply_job = ApplyJob.new 4 @apply_job.job_id = params[:job_id] 5 end 6 7 def confirm 8 @apply_job = ApplyJob.new(apply_params) 9 @apply_job.job_id = apply_params[:job_id] 10 end 11 12 def done 13 @apply_job = ApplyJob.new(apply_params) 14 @apply_job.user_id = User.find_by(id: 1).id 15 @apply_job.job_id = apply_params[:job_id] 16 if @apply_job.save! -
Master
@phuongnhm Sao chỗ này dùng
save!vậy em? -
-
-
-
1 1 class ApplicationMailer < ActionMailer::Base 2 default from: 'from@example.com' 2 default from: 'nhmphuong1005@gmail.com' -
Master
@phuongnhm Chỗ này nên để email của hệ thống. Ví dụ như
info@venjob.comchẳn hạn -
-
-
1 1 class ApplyJob < ApplicationRecord 2 2 belongs_to :user 3 3 belongs_to :job 4 has_one_attached :cv 5 validates :name, presence: true, length: { maximum: 200 } 6 VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i 7 validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAIL_REGEX } 8 validates :cv, attached: true, content_type: { in: 'application/pdf', message: 'must be a valid cv format' } -
Master
@phuongnhm Validate thêm limit size của file nữa nha em.
-
-
-
app/views/apply_jobs/confirm.html.slim 0 → 100644
1 .ribbon -
MasterEdited by Thanh Hung Pham
@phuongnhm Chỗ này sao không render lại
ribbonem?.ribbon ul.progressbar li .span.indicator .span.title Apply li.active .span.indicator.2 .span.title Confirm li .span.indicator.3 .span.title Done- Suy nghĩ thêm solution để render cái
activecho từng step tương ứng nha
- Suy nghĩ thêm solution để render cái
-
-
-
app/views/apply_jobs/confirm.html.slim 0 → 100644
1 .ribbon 2 ul.progressbar 3 li 4 .span.indicator 5 .span.title Apply 6 li.active 7 .span.indicator.2 8 .span.title Confirm 9 li 10 .span.indicator.3 11 .span.title Done 12 h2.text-center.p-4 13 | CONFIRM INFORMATION 14 .col-md-6.offset-md-3 15 = form_with(model: @apply_job, url: '/done', local: true) do |f| -
Master
@phuongnhm
url: '/done'Chỗ này mình nên dùng helpers có sẵn nha emxxxx_path -
-
-
app/views/apply_jobs/confirm.html.slim 0 → 100644
3 li 4 .span.indicator 5 .span.title Apply 6 li.active 7 .span.indicator.2 8 .span.title Confirm 9 li 10 .span.indicator.3 11 .span.title Done 12 h2.text-center.p-4 13 | CONFIRM INFORMATION 14 .col-md-6.offset-md-3 15 = form_with(model: @apply_job, url: '/done', local: true) do |f| 16 = f.hidden_field :job_id 17 = f.label :name 18 = f.text_field :name, required: true, disabled: true,length: { maximum: 200 }, placeholder: "Type name...", class: 'form-control' -
MasterEdited by Thanh Hung Pham
@phuongnhm Add space after
,disabled: true,length: { maximum: 200 }- Tương tự chỗ
email
-
-
-
app/views/apply_jobs/confirm.html.slim 0 → 100644
4 .span.indicator 5 .span.title Apply 6 li.active 7 .span.indicator.2 8 .span.title Confirm 9 li 10 .span.indicator.3 11 .span.title Done 12 h2.text-center.p-4 13 | CONFIRM INFORMATION 14 .col-md-6.offset-md-3 15 = form_with(model: @apply_job, url: '/done', local: true) do |f| 16 = f.hidden_field :job_id 17 = f.label :name 18 = f.text_field :name, required: true, disabled: true,length: { maximum: 200 }, placeholder: "Type name...", class: 'form-control' 19 = f.hidden_field :name, required: true, length: { maximum: 50 } -
Master
@phuongnhm hidden field mà, không cần validate nha em. Tương tự bên
email -
-
-
app/views/apply_jobs/done.html.slim 0 → 100644
1 .ribbon.py-4 -
Master
@phuongnhm Tương tự render
ribbonlại nha em -
-
-
app/views/apply_jobs/done.html.slim 0 → 100644
1 .ribbon.py-4 2 ul.progressbar 3 li 4 .span.indicator 5 .span.title Apply 6 li 7 .span.indicator.2 8 .span.title Confirm 9 li.active 10 .span.indicator.3 11 .span.title Done 12 .container.py-4 13 h3.py-3.text-center 14 | Thank you for apply -
Master
@phuongnhm Miss requirement nha em. Thêm link
Back to TOP pagequay về trang chủ nha em -
-
-
app/views/apply_jobs/new.html.slim 0 → 100644
1 .ribbon -
Master
@phuongnhm Tương tự render
ribbonlại nha em -
-
-
app/views/apply_jobs/confirm.html.slim 0 → 100644
14 .col-md-6.offset-md-3 15 = form_with(model: @apply_job, url: '/done', local: true) do |f| 16 = f.hidden_field :job_id 17 = f.label :name 18 = f.text_field :name, required: true, disabled: true,length: { maximum: 200 }, placeholder: "Type name...", class: 'form-control' 19 = f.hidden_field :name, required: true, length: { maximum: 50 } 20 21 = f.label :email 22 = f.text_field :email, required: true, disabled: true,length: { maximum: 255 }, format: { with: ApplyJob::VALID_EMAIL_REGEX}, placeholder: "Type email...", class: 'form-control' 23 = f.hidden_field :email, required: true, length: { maximum: 255 }, format: { with: ApplyJob::VALID_EMAIL_REGEX} 24 p.my-1 25 = f.label :cv, "CV" 26 p 27 = f.file_field :cv, required: true, accept: "application/pdf" 28 .span.p-4.text-center 29 = link_to "Back", apply_path, class: "btn btn-primary btn-lg btn-space" -
Master
@phuongnhm Em test xem
Backcó giữ được thông tin người dùng đã nhập không? -
-
-
app/views/apply_jobs/new.html.slim 0 → 100644
2 ul.progressbar 3 li.active 4 .span.indicator 5 .span.title Apply 6 li 7 .span.indicator.2 8 .span.title Confirm 9 li 10 .span.indicator.3 11 .span.title Done 12 h2.text-center.p-4 13 | APPLY INFORMATION 14 .col-md-6.offset-md-3 15 = form_with(model: @apply_job, url: '/confirm', local: true) do |f| 16 = f.hidden_field :job_id 17 = f.text_field :name, required: true,length: { maximum: 200 }, placeholder: "Type name...", class: 'form-control' -
Master
@phuongnhm Add space after
,required: true,length:
-
Master
@phuongnhm Chỗ này chưa sửa hả em?
-
-
-
-
-
-
-
1 class RemoveCvFromApplyJobs < ActiveRecord::Migration[6.1] 2 def change 3 remove_column :apply_jobs, :cv, :binary -
Master
@phuongnhm Chỗ này không ảnh hưởng nhiều. Nhưng
remove_columnkhông cần kiểu dữ liệu nha em. -
-
-
-
Toggle commit list
-
merged
Toggle commit list