Instead of routing to index.html, I want my开发者_Go百科 control to go to the login controller in rails when i go to http://localhost:3000 . How can I achieve this?
You need to set root path in config/routes.rb
, example:
root 'login#index'
On latest version go on config/routes.rb and replace with home#index with your default controller Rails.application.routes.draw do
root :to => 'home#index' end
In addition to NARKOZ's answer, you might want to check out the RailsGuides Getting Started guide.
精彩评论