Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6.1.3.2 breaks Administrate #1971

Closed
swalberg opened this issue May 5, 2021 · 4 comments · Fixed by #1972
Closed

Rails 6.1.3.2 breaks Administrate #1971

swalberg opened this issue May 5, 2021 · 4 comments · Fixed by #1972
Labels
bug breakages in functionality that is implemented

Comments

@swalberg
Copy link

swalberg commented May 5, 2021

  • What were you trying to do?

Upgrade to the latest version of Rails

  • What did you end up with (logs, or, even better, example apps are great!)?

An ActionView::Template::Error (see below)

  • What versions are you running?
    • Rails 6.1.3.2
    • administrate 0.15.0

rails/rails@c4c21a9 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.

@michaelwebb76
Copy link

michaelwebb76 commented May 6, 2021

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

@nickcharlton
Copy link
Member

Thanks for opening this! I'm going to look at #1972 next and see if we need to make any other changes.

@cgrothaus
Copy link

@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 of link_to and add .to_sym (as in #1972).

@cgrothaus
Copy link

I just want to confirm that this issue also affects Rails 6.0.3.7.

miharekar pushed a commit to peteromallet/Advisable that referenced this issue May 6, 2021
Broken because of the security updates in Rails.
More info: thoughtbot/administrate#1971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug breakages in functionality that is implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants