开发者

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

开发者 https://www.devze.com 2023-03-29 04:19 出处:网络
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

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

精彩评论

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