Daniel Guettler
2008-Jan-25 16:10 UTC
Routing optimization, named routes and default url options
I came across this when switching from rails 1.2.6 to 2.0.2, there is a change in the way routes are generated between these to version due to the routing optimization in rails 2.0.2. In version 1.2.6 it was possible to overwrite the default_url_options method in ActionController::Base to define parameters attached to each generated url. Due to the routing optimization in rails 2.0.2 this is not anymore possible if no other parameters are passed to the generated named route method the default options will not be appended anymore. Is this an intentional change or can this be considered a bug? Daniel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2008-Jan-25 20:18 UTC
Re: Routing optimization, named routes and default url options
On Jan 26, 2008 5:10 AM, Daniel Guettler <daniel.guettler@gmail.com> wrote:> > I came across this when switching from rails 1.2.6 to 2.0.2, there is > a change in the way routes are generated between these to version due > to the routing optimization in rails 2.0.2. > In version 1.2.6 it was possible to overwrite the default_url_options > method in ActionController::Base to define parameters attached to each > generated url. > Due to the routing optimization in rails 2.0.2 this is not anymore > possible if no other parameters are passed to the generated named > route method the default options will not be appended anymore. > > Is this an intentional change or can this be considered a bug?This is a bug, please open a ticket for it at dev.rubyonrails.org, if you could attach a simplified version of your application it''ll help track it down. In the meantime you can disable the optimisation code by setting config.action_controller.optimise_named_routes = false -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Daniel Guettler
2008-Jan-25 21:06 UTC
Re: Routing optimization, named routes and default url options
I created a ticket with simplified application: http://dev.rubyonrails.org/ticket/10925 Daniel On Jan 25, 3:18 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> On Jan 26, 2008 5:10 AM, Daniel Guettler <daniel.guett...@gmail.com> wrote: > > > > > I came across this when switching from rails 1.2.6 to 2.0.2, there is > > a change in the way routes are generated between these to version due > > to the routing optimization in rails 2.0.2. > > In version 1.2.6 it was possible to overwrite the default_url_options > > method in ActionController::Base to define parameters attached to each > > generated url. > > Due to the routing optimization in rails 2.0.2 this is not anymore > > possible if no other parameters are passed to the generated named > > route method the default options will not be appended anymore. > > > Is this an intentional change or can this be considered a bug? > > This is a bug, please open a ticket for it at dev.rubyonrails.org, if > you could attach a simplified version of your application it''ll help > track it down. > > In the meantime you can disable the optimisation code by setting > config.action_controller.optimise_named_routes = false > -- > Cheers > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---