Topic: URL index method

Hi everybody!

When i create a controller called home and a index method.
Then i have to go to:
http://localhost:3000/home/index to view the index method.

How can i do so rails automatic know that: http://localhost:3000/home is the same as http://localhost:3000/home/index.

(without using match)

Re: URL index method

=> rails generate controller home index

open views/index.html.erb and write there whatever you want smile

delete the default page from your application: public/index.html
Open the file config/routes.rb in your editor and find line   
# root :to => "welcome#index" .
Change it into
root :to =>"home"

Now if you navigate to http://localhost:3000 in your browser, you’ll see the home/index view.
(If you don’t specify an action, Rails assumes the index action.)