I did this in app/helpers/url_helper.rb
module UrlHelper def resource_path(resource, parameters = {}) # my implementation "/#{resource.category}/#{resource.name}#{ "?#{parameters.to_query}" if parameters.present? }" end end
I know that there are ways to define such a nested route, but I have a code base that uses this route in several parts, as the question says.
I tried using the old method, but was not recognized:
alias_method :old_resource_path, :resource_path
source share