Skip to content

Instantly share code, notes, and snippets.

@sutter
Created March 25, 2015 16:13
Show Gist options
  • Save sutter/8497d5830cf11085f417 to your computer and use it in GitHub Desktop.
Save sutter/8497d5830cf11085f417 to your computer and use it in GitHub Desktop.
Form
<%= form_for(@job.new_record? ? [current_user.company, @job] : @job, html: {class: 'pure-form pure-form-stacked '}) do |f| %>
<% if @job.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@job.errors.count, "error") %> prohibited this job from being saved:</h2>
<ul>
<% @job.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<p class="field">
<%= f.label :title %>
<%= f.text_field :title, class: 'mgn-t10 mgn-btm20' %>
</p>
<p class="field">
<%= f.label :description %>
<%= f.text_area :description, class: 'mgn-t10 mgn-btm20' %>
</p>
<p class="field">
<%= f.label :type_of_contract %>
<%= f.select :type_of_contract, Job.type_of_contracts %>
</p>
<p class="field">
<%= f.label :job_category %>
<%= f.select :job_category, Job.job_categories, class: 'select mgn-t10 mgn-btm20' %>
</p>
<div class="actions">
<%= f.submit 'Créer le Job', class: 'button' %>
</div>
<% end %>
@jonathanpath
Copy link

tu fais du ruby maintenant ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment