url_for seems to have a bug when dealing with modules. If in the module a/controller b directory If I make the following call to url_for to link to another action in the same controller passing the parameters through, an incorrect URL is generated. url_for(:action => "test", :params => params) The url generated by this code is: /a/a/b/test?......... The module name a got repeated. To get this to behave right, you need to manually add :controller => nil to list of options to url_for. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Andrew Selder <rails-mailing-list@...> writes:> url_for(:action => "test", :params => params) > > The url generated by this code is: > /a/a/b/test?......... > > The module name a got repeated. To get this to behave right, you need to > manually add :controller => nil to list of options to url_for.I seem to remember there being a reason for that, to do with how controllers are rooted to something or other (I forget). In any case, it definitely goes against principle of least surprise so I''d call it a bug too Gareth --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---