Rahul
Rahul

Reputation: 47086

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

Instead of routing to index.html, I want my control to go to the login controller in rails when i go to http://localhost:3000 . How can I achieve this?

Upvotes: 0

Views: 8656

Answers (3)

NARKOZ
NARKOZ

Reputation: 27901

You need to set root path in config/routes.rb, example:

root 'login#index'

Upvotes: 11

Kashif
Kashif

Reputation: 498

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

Upvotes: 0

Mitch Lindgren
Mitch Lindgren

Reputation: 2160

In addition to NARKOZ's answer, you might want to check out the RailsGuides Getting Started guide.

Upvotes: -1

Related Questions