Does it mean nextpage.rhtml must has a controller & action ‘show’, in
order to transfer to from index.rhtml (index.rhtml has <%= link_to
‘nextpage’ :action=>‘show’ %> ?) to nextpage.rhtml.
This link won’t change controllers because you haven’t specified a
“:controller” option. This link will simply point to the “show” action
in the same controller as index.rhtml. That means that rails will try to
render a view named show.rhtml in the same directory as index.rhtml.
If you want to go to the nextpage.rhtml view (nextpage action) in the
current controller, then you need to use a link like this:
<%= link_to ‘Next Page’ :action=>‘nextpage’ %>
Note that the first string is what the user sees in the link. If you
want to go to the show.rhtml view in the nextpage controller (for
example), then you need a link like this:
<%= link_to ‘Next Page’ :controller => ‘nextpage’, :action=>‘show’ %>