开发者

How to route to the default controller instead of index.html?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜