Feature/remove favorite job,show applied jobs
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
-
app/views/apply/index.html.erb 0 → 100644
1 <div class="area-title-wrapper"> 2 <h3>Applied Jobs List</h3> 3 </div> 4 <div> 5 <%= paginate @applies %> 6 <div class="row row-cols-3"> 7 <%= render partial: "apply/applied", collection: @applies %> -
Master
nên đặt tên file này là apply, tương đương với model Apply
-
-
-
49 49 <dt class="col-sm-3">Requirement:</dt> 50 50 <dd class="col-sm-9"><%= simple_format @job.requirement %></dd> 51 51 </dl> 52 <%= link_to "Apply", apply_path, class: "btn btn-primary" %> 53 <%= render "favorites/favorite_form", job: @job %> 52 <%= link_to_if(current_user.applies.find_by(job_id: @job.id).nil?, "Apply", apply_path, class: "btn btn-primary") { link_to "Apply", apply_path, class: "btn btn-primary disabled"} %> -
Master
viết thành block if else cho dễ nhìn
-
-
-
35 35 get "apply/:job_id", to: "apply#new", as: "apply" 36 36 post "confirm/:job_id", to: "apply#confirm", as: "confirm" 37 37 post "done/:job_id", to: "apply#done", as: "done" 38 get "applied", to: "apply#index", as: "applied" -
Master
sử dụng resources
-
-
-
-
1 1 class ApplyController < ApplicationController 2 2 before_action :check_user_logged_in? 3 before_action :load_job, only: [:new, :done, :confirm] 3 before_action :load_job, only: [:new, :done, :confirm, :index] -
Master
hàm index mình có dùng đến
@jobkhông, kiểm tra xem có cần load job hay k -
Master
Khi xem server log thì có thế thấy lúc chạy hàm index thì cần tới load job nhưng ko cần
@jobnên chỗ này có thể bỏ:indexđi để giàm thời gian render trang view của jog apply. -
-
-
Toggle commit list