zorab47 / active_admin-sortable_tree

Show ActiveAdmin index as a nested tree with drag'n'drop
MIT License
163 stars 127 forks source link

Rails5 fix: convert params to Hash before using them #52

Closed jtomaszewski closed 8 years ago

jtomaszewski commented 8 years ago

Fixes following error which is sometimes returned in rails 5:

NoMethodError: undefined method `inject' for #<ActionController::Parameters:0x007f89a2faac70>
Did you mean? inspect
1. File "/socialtravel/releases/20160123175638/vendor/bundle/ruby/2.3.0/gems/active_admin-sortable_tree-0.2.1/lib/active_admin/sortable_tree/controller_actions.rb" line 27 in block in sortable
2. File "/socialtravel/releases/20160123175638/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0.beta1/lib/action_controller/metal/basic_implicit_render.rb" line 4 in send_action
...
zorab47 commented 8 years ago

Looks great, thanks! :sparkles: I'll make a new gem release soon.

zorab47 commented 8 years ago

Unfortunately, the Rails 5 fix is more involved than adding a call to to_unsafe_h.

Thanks for the PR!