On Apr 17, 2:59 am, Jatin kumar <
jatinkumar.n...@gmail.com> wrote:
> On Sun, Apr 17, 2011 at 6:46 AM, amrit pal pathak <
amritpalpath...@gmail.com
>
>
>
>
>
>
>
>
>
> > wrote:
> > I followed a tutorial to learn ruby on rails at
> >
http://guides.rubyonrails.org/v2.3.8/getting_started.html
> > After creating a view and controller as "script/generate controller
> > home index" and then i changed the contents of app/view/home/
> > index.html.erb file according to tutorial into one line as
> > <h1>Hello, Rails!</h1>
>
> > Now i started the server as script/
> > server(successfully started) and when i navigate to localhost:3000/
> > home/index, i got a error message which says
>
> > ROUTING ERROR
> > No route matches "/home/index" with {:method=>:get}
>
> > Remove the /public/index.html file in your app directory.
>
> Check to see if you have a route for root in your routes.rb file.
> If not, make it
> *map.root :controller => "home"*
> If you still have problems, post the contents of your routes file.
I added the *map.root :controller => "home"* at the bottom of
router.rb file and it worked.so i could accessed now "localhost:3000/
home/index
Please explain how it (*map.root :controller => "home"*) is
working (means which part calls to which).
Thanks