Skip to content

Instantly share code, notes, and snippets.

Created June 16, 2010 19:27
Show Gist options
  • Save anonymous/441141 to your computer and use it in GitHub Desktop.
Save anonymous/441141 to your computer and use it in GitHub Desktop.
<!-- file is: show.html.erb of the POST controller ...not Comment controller -->
<% form_for @post do |f| %>
<!-- code to show my post -->
<!-- there is more here to show my post -->
f.text_field :body
<% form_for [@post, Comment.new] do |f| %>
Body: <%= f.text_field :body %>
<p><%= f.submit "Add Comment" %></p>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment