Skip to content

Instantly share code, notes, and snippets.

@axilaris
Created February 20, 2014 06:59
Show Gist options
  • Save axilaris/9108343 to your computer and use it in GitHub Desktop.
Save axilaris/9108343 to your computer and use it in GitHub Desktop.
<%= form_for(@comment) do |f| %>
<% if @comment.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2>
<ul>
<% @comment.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user_id %><br />
<%= f.collection_select :user_id, User.all, :id, :email %>
</div>
<div class="field">
<%= f.label :comments_text %><br>
<%= f.text_field :comments_text %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment