On Apr 28, 3:25 am, Colin Law <clan...@googlemail.com> wrote:
> On 28 April 2011 02:37, amrit pal pathak <amritpalpath...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
> > On Apr 27, 10:52 am, Pale Horse <li...@ruby-forum.com> wrote:
> >> > amritpal p. wrote in post #995323:
>
> >> > class SayController < ApplicationController
> >> >  def hello
> >> >   @timee = Time.now
> >> >  end
> >> >  def goodbye
>
> >> >  end
> >> > end
>
> >> > /app/views/say/hello.html.erb looks like:
>
> >> > It is now <%= @timee %>
> >> > <a href="/say/goodbye">Goodbye</a>
>
> >> Instead of <a href="/say/goodbye">Goodbye</a>, use <%= link_to
> >> "Goodbye", :action => "goodbye" %>
> >                It didn't help,error says
> >       No route matches {:controller=>"say", :action=>"goodbye"}
>
> >> > /app/views/say/goodbye.html.erb looks like:
>
> >> > <h1>Good bye buddy!</h1>
>
> >> > When i click on Goodbye link given in hello.html.erb file it says
> >> > "No route matches "/say/goodbye". It made me desperate. I don't
> >> > know why this error persists.
>
> >> Have you set up a route for it in config/routes.rb?
> >             yes is set up as:
>
> >           root :to => "say#hello"
>
> So you think that the above line, which says route '/' to say#hello'
> is going to route /say/goodbye somewhere?  
      No it will not route to /say/goodbye,but it will route to /say/
hello which has a link to /say/goodbye method.
 Can you tell me solution?

Thanks
As I said previously you
> need to re-read the Rails Guide on routing.  Read every line and make
> sure you understand it.  If you think you already understand it then
> you are mistaken.
>
> Colin

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to