On Apr 29, 11:33 am, Hassan Schroeder <[email protected]>
wrote:
> On Fri, Apr 29, 2011 at 8:08 AM, amrit pal pathak
>
> <[email protected]> wrote:
> > I have one controller(home) with two methods(empty) ,name are
> > index,new).Corressponding have 2 .html.erb files in home view.How to
> > give a link from file index.html.erb to new.html.erb i.e syntax?
> >       I tried <%=link_to 'Click me',home_new_path%>,but it failed
>
> FYI, "it failed" is not a very useful problem description.
>
> Regardless, you should be able to see the proper syntax if you run
> `rake routes`

   1)  rake routes say:
    (in /home/amrit/mani)
home_index GET /home/index(.:format)
{:action=>"index", :controller=>"home"}

      2)    Then i changed the syntax in index.html.erb file as:
<%=link_to "Goodbyyye",:action=>"new", :controller=>"home"%>

                               Again strucked error,says:
 No route matches {:controller=>"home", :action=>"new"}

Thank you

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to