app/views/refinery/jobs/job_applications/_form.html.erb in refinerycms-jobs-3.0.4 vs app/views/refinery/jobs/job_applications/_form.html.erb in refinerycms-jobs-3.0.5
- old
+ new
@@ -1,8 +1,8 @@
<%= form_for [refinery, job_application], url: refinery.jobs_job_applications_path, html: { multipart: true } do |f| %>
- <h2><%= t('.job_application_for_position', job_title: @job.title) %></h2>
+ <h2><%= t('.job_application_for_position', job_title: job.title) if job.present? %></h2>
<%= render '/refinery/admin/error_messages', {object: @job_application, include_object_name: true} %>
<div class='field'>
<%= f.label :name, class: 'required' %>
@@ -17,18 +17,20 @@
<div class='field'>
<%= f.label :phone, class: 'required' %>
<%= f.telephone_field :phone, class: 'text', required: 'required' %>
</div>
- <% if !jobs.nil? %>
+ <% if jobs.present? %>
<% if jobs.many? %>
<div class='field'>
<%= f.label :job_id, class: 'required' %>
<%= f.select :job_id, jobs.collect {|j| [ j.title, j.id ] }, { prompt: t('select_a_job') }, required: true %>
</div>
<% else %>
<%= f.hidden_field :job_id, value: jobs.first.id %>
<% end %>
+ <% else %>
+ <%= f.hidden_field :job_id, value: job.id %>
<% end %>
<div class='field'>
<%= f.label :cover_letter, class: 'required' %>
<%= f.text_area :cover_letter, class: 'text', required: 'required' %>