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 5.0: undefined method `hidden_actions' #18

Closed
Nowaker opened this issue Dec 11, 2020 · 3 comments
Closed

Rails 5.0: undefined method `hidden_actions' #18

Nowaker opened this issue Dec 11, 2020 · 3 comments

Comments

@Nowaker
Copy link
Contributor

Nowaker commented Dec 11, 2020

After upgrading from Rails 4.2.x to 5.0.x, I've encountered this problem with make_resourceful:

ActionController::RoutingError (undefined method `hidden_actions' for SitesController:Class):

/home/nowaker/.rvm/gems/ruby-2.6.3/bundler/gems/make_resourceful-787e73272fe4/lib/resourceful/builder.rb:54:in `apply'
/home/nowaker/.rvm/gems/ruby-2.6.3/bundler/gems/make_resourceful-787e73272fe4/lib/resourceful/maker.rb:69:in `make_resourceful'
app/controllers/sites_controller.rb:5:in `<class:SitesController>'
@Nowaker
Copy link
Contributor Author

Nowaker commented Dec 11, 2020

Uncommenting this line resolves the problem:

kontroller.hidden_actions.reject! &@ok_actions.method(:include?)

I suggest changing it to:

if kontroller.respond_to?(:hidden_actions) 
  kontroller.hidden_actions.reject! &@ok_actions.method(:include?)
end

This is because Rails 5+ no longer has a notion of "hidden actions".

@Nowaker
Copy link
Contributor Author

Nowaker commented Dec 11, 2020

#19

@Nowaker
Copy link
Contributor Author

Nowaker commented Jan 22, 2024

Fixed in #19

@Nowaker Nowaker closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant