Skip to content

Commit

Permalink
Add fields for comments in post form
Browse files Browse the repository at this point in the history
  • Loading branch information
prathe committed Feb 17, 2012
1 parent 5c3beb1 commit 2d3767b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -21,3 +21,9 @@ Edit *app/models/post.rb*
### Continue setup…

bundle exec rake db:seed

Edit *app/views/posts/_form.html.erb* add nested comments fields in the post form

<%= f.fields_for :comments do |comment_form| %>
<%= comment_form.text_area :content %>
<% end %>
5 changes: 5 additions & 0 deletions app/views/posts/_form.html.erb
Expand Up @@ -19,6 +19,11 @@
<%= f.label :content %><br />
<%= f.text_area :content %>
</div>

<%= f.fields_for :comments do |comment_form| %>
<%= comment_form.text_area :content %>
<% end %>

<div class="actions">
<%= f.submit %>
</div>
Expand Down

0 comments on commit 2d3767b

Please sign in to comment.