How can I create a method like show and link to it from index?
what should I put in routes.rb? what should I put to link to it?
How can I create a method like show and link to it from index?
what should I put in routes.rb? what should I put to link to it?
why do you want to link to it from index? do you mean an actual "link_to" hyperlink? or do you mean that you want it to display INSTEAD of index?
if the latter, in your routes.rb file put:
map.connect '', :controller => 'site', :action => 'show'
if your site were at www.mysite.com and your user tried to go there they would be redirected to the show action of the site controller....