Created
November 11, 2011 21:54
-
-
Save sapient/1359429 to your computer and use it in GitHub Desktop.
Most recent form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@post) do |f| %> | |
<% if @post.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> | |
<ul> | |
<% @post.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label :title %> | |
<br/> | |
<%= f.text_field :title %> | |
</div> | |
<div class="field"> | |
<%= f.label :content %> | |
<br/> | |
<%= f.text_area :content %> | |
</div> | |
<div class="field"> | |
<%= f.label :category %> | |
<br/> | |
<%= f.text_field :category %> | |
</div> | |
<div class="field"> | |
<%= f.fields_for :attachments do |attach| %> <br> | |
<%= attach.file_field :photo %> <br> | |
<%= attach.collection_select :category_id, AttachmentCategory.all, :id, :name %> | |
<% end %> | |
<br> | |
</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