Basic of Rails routing -rails routes basic hack

Here I am going to focus on only basic routing technic of Rails.

If you are new in rails. Just wanted to remind you.

First go to Rails project’s “public” folder and delete or rename the index.html file. If index.html file is there then default routing will not run.

If you want Users controller’s index page as a home page of site then go for this code in routes.rb file.

map.connect ”, { :controller => ‘users’, :action => ‘index’ }

In view you can use link for home page and logo of site(basic hack)

<%= link_to(“HOME”,{:controller=>’/’}) %>