Skip to content

Instantly share code, notes, and snippets.

@cmilfont
Created October 20, 2013 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmilfont/7070443 to your computer and use it in GitHub Desktop.
Save cmilfont/7070443 to your computer and use it in GitHub Desktop.
<%= form_for(@technique) do |f| %>
<% if @technique.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@technique.errors.count, "error") %> prohibited this technique from being saved:</h2>
<ul>
<% @technique.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br>
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :description %><br>
<%= f.text_area :description, size: "84x20" %>
</div>
<div class="field">
<%= f.label :martialarts %><br>
<%= select_tag 'technique[martialart_ids][]', options_from_collection_for_select(Martialart.all.order(:name), "id", "name", @technique.martialarts.map(&:id)), { :multiple => true, :size =>10 } %>
</div>
<div class="actions">
<%= f.submit "Salvar" %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment