You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scope '/myscope(/:alternative_param)', :defaults => {:alternative_param => nil}
namespace :mynamespace do
resources :foos
end
end
foos_controller.rb
def default_url_options
{:alternative_param=>params[:alternative_param]}
en
I say, default params set on "controller#default_url_options" must override the "routes :default" assigment, but works on the contrary routes override the provide callback functionality to defalut_ulr_option.
I would say that Controller#default_url_options should override default_url_options in routes.rb but not override a route's defaults because it's a global setting whereas a route's defaults are specific. There are plenty of ways you can achieve what you want by overriding the url helper directly either in a helper or directly on the Rails.application.routes.url_helpers module
default_url_options provided method should override :defaults option on routes entry
and not vice versa.
The text was updated successfully, but these errors were encountered: