RailsCasts Pro episodes are now free!
Learn more or hide this
Resources
ActionController::Routing::Routes.draw do |map| map.resources :articles, :has_many => :comments, :shallow => true map.resources :comments, :only => [:index] map.root :articles end
<%= link_to pluralize(@article.comments.size, 'comment'), article_comments_path(@article) %> <%= link_to "New Comment", new_article_comment_path(@article) %> <%= link_to "Edit", edit_comment_path(comment) %> <%= link_to "Destroy", comment, :method => :delete, :confirm => "Are you sure?" %> <% form_for [@article, @comment] do |f| %>