I have a named route:
resources :groups do ... end
Groups have an overriden to_param method using the StringEx gem:
acts_as_url :name, sync_url: true
def to_param
url
end
And most of the time, I can call it by passing a group in:
group_path(g)
But sometimes (and I haven't been able to find a clear link on the circumstances) it gives me this:
ActionController::RoutingError (No route matches {:action=>"show", :controller=>"groups", :id=>#<Group id: 121, name: "Example", kind: "ex" ...
Really looks like it's not calling to_param, and is just calling to_s or inspect on the group.
Any idea what's going on? This is awfully frustrating.