Getting Started

I am new to rails.

When I generate scaffold for products , in products/index.html i have
this
code

Listing users

<% @users.each do |user| %>

<% end %>
Name
<%=h user.name %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %>

<%= link_to ‘New user’, new_user_path %>


My doubt is in link_to tags,

<%= link_to ‘Show’, user %>
<%= link_to ‘Edit’, edit_user_path(user) %>
<%= link_to ‘New user’, new_user_path %>

Why not show_user_path(user) ? for first link ‘Show’

Because by default the show_path is used for a model if you hand it to
the
link_to helper.

On Sat, Sep 22, 2012 at 1:19 PM, rabinprithvi <