Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## router.rb
- Merb::Router.prepare do
- resources :posts do |posts|
- posts.resources :comments
- end
- default_routes
- end
- ## /views/posts/show.html.haml
- # ...
- # This form url becomes: /posts/:post_id/comments/new
- # What controller and action are expected?
- = form_for(@comment, :action => url(:new_post_comment, @post)) do
- %p= text_field :posted_by
- %p= text_area :body
- %p= submit "Add Comment"
- # ...
Add Comment
Please, Sign In to add comment