In my last Rails project, I had to rewrite default_url_optionsin application_controller.rbto always pass a parameter through each request, for example:
def default_url_options
{ :my_default_param => my_param_value }
end
Now each URL helper appends my_default_param at the end of each generated URL. For example, it user_url(@current_user)generates a URL, for example:
http:
But sometimes I need to generate a url without my_default_param . Is there any option that I can pass to the url helper so that user_url(@current_user, some_option: some_option_value) only returns:
http:
?
PN: I already tried with :overwrite_params=> { }, but it does not work, perhaps because it was evaluated before default_url_options.
And if not, is there another way to get the @current_user URL without my_default_param attached?
Thanks.