My model called Action has a dashboard, but this error happens preventing it from loading:
undefined method `fetch' for "index":String
Which comes from this part of administrate/application_controller.rb around line 103:
def order
@order ||= Administrate::Order.new(
params.fetch(resource_name, {}).fetch(:order, nil), # <-- error here
params.fetch(resource_name, {}).fetch(:direction, nil),
)
end
The problem is that resource_name is action, which conflicts with the normal param called action which tells us that in this case, we want the index. We therefore get 'index' from the params, not nil which would give us the default empty object, which fetch would work on.
Is there a way around this?
I also have a model called Action, and I'm running across this issue. +1
I can confirm that this is an issue at the moment. Currently, we get an error when link_to() receives a value of action that is not a route action. Unfortunately our sorting parameters create this situation if a model is called "Action" (and I guess also if called "Controller"), so this breaks.
Most helpful comment
I also have a model called Action, and I'm running across this issue. +1