Upgrade to the latest version of Rails
An ActionView::Template::Error (see below)
https://github.com/rails/rails/commit/c4c21a9f8d7c9c8ca6570bdb82d64e2dc860e62c requires that things passed to route helpers be symbols and not strings. https://github.com/thoughtbot/administrate/blob/main/app/views/administrate/application/index.html.erb#L44 and L56 break with
ActionView::Template::Error:
Please use symbols for polymorphic route arguments.
I'm not sure how prevalent this is within Administrate since I was just testing the simple show case when I tripped on this.
I hate monkey patches with all of my soul, but this monkey patch _seems to be_ (for us) a functioning workaround until a new version of Adminstrate is released:
class Administrate::ResourceResolver
def namespace
controller_path.split("/").first.to_sym
end
end
Thanks for opening this! I'm going to look at #1972 next and see if we need to make any other changes.
@michaelwebb76
I hate monkey patches with all of my soul, but this monkey patch _seems to be_ (for us) a functioning workaround until a new version of Adminstrate is released:
class Administrate::ResourceResolver ...For us, this was not enough. I also have to monkey patch
Administrate:Namespace(as in #1972), and in one custom view I have to change the arguments oflink_toand add.to_sym(as in #1972).
I just want to confirm that this issue also affects Rails 6.0.3.7.
Most helpful comment
I just want to confirm that this issue also affects Rails 6.0.3.7.