Create ID12 My Job

parent 2e0f39f4
Pipeline #1018 failed with stages
in 0 seconds
......@@ -63,3 +63,7 @@
.industry:last-child::after, .location:last-child::after {
content: "";
}
.my-job-label {
padding: 30px;
margin: 30px;
}
......@@ -5,14 +5,17 @@ class JobAppliedsController < ApplicationController
def new
end
def show
arr_job_id = current_user.job_applieds.pluck(:job_id)
@jobs = Job.where(id: arr_job_id).order(updated_at: :asc)
end
def confirmation
@user = current_user.job_applieds.new(apply_params)
@user.cv_user = current_user.cv_user if apply_params[:cv_user].blank?
if @user.invalid?
@user.errors.full_messages.each do |message|
flash[:danger] = message
redirect_to apply_job_path(job_id: apply_params[:job_id])
end
flash[:danger] = @user.errors.full_messages.join('<br>')
redirect_to apply_job_path(job_id: apply_params[:job_id])
end
end
......
<div class="border border-dark rounded">
<div class="job-details">
<div class="title">
<%= link_to job_detail_path(job.id) do %><strong>
<%= job.title %></strong>
<% end %>
</div>
<div class="introduction">
<%= strip_tags(job.format_desc) %><br>
<%= link_to 'Read more..', job_detail_path(job.id) %>
</div>
<div class="row">
<div class="col-4">
<%= job.cities.map(&:name).join(' | ') %>
</div>
<div class="salary col-4">
Salary: <%= job.salary %>
</div>
<div class="applied-at col-4">
<strong>Applied at:</strong>
<% job.job_applieds.each do |info| %>
<%= info.updated_at.strftime('%d/%m/%Y') %>
<% end %>
</div>
</div>
</div>
</div>
<br>
<div class="container">
<h1 class="text-center my-job-label">My Job</h1>
<%= render partial: "job_applieds/my_jobs", collection: @jobs, as: :job %>
</div>
<div class="flash rounded">
<% flash.each do |key, value| %>
<div class="alert alert-<%= key %>"><%= value %></div>
<div class="text-center alert alert-<%= key %>"><strong><%= value.html_safe %></strong></div>
<% end %>
</div>
......@@ -34,7 +34,7 @@
</div>
<%= link_to 'Update', my_page_info_path, class: 'btn btn-outline-primary btn-lg update-btn' %>
<%= link_to 'My Jobs', '#', class: 'btn btn-outline-info btn-lg my-jobs-btn' %>
<%= link_to 'My Jobs', my_jobs_path, class: 'btn btn-outline-info btn-lg my-jobs-btn' %>
<% end %>
</div>
</div>
......
......@@ -24,6 +24,8 @@ Rails.application.routes.draw do
post 'confirm', to: 'job_applieds#confirmation', as: :confirm_job
post 'done', to: 'job_applieds#create', as: :finished_apply
get '/my/jobs', to: 'job_applieds#show', as: :my_jobs
resources :jobs
get 'detail/:id', to: 'jobs#show', as: :job_detail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment