Guest User

Untitled

a guest
Dec 10th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. class Admin::ResourcesController < Admin::ApplicationController
  2. inherit_resources
  3. respond_to :html
  4.  
  5. def sort
  6. @menu_item = resource_class.find(params[:id])
  7. @menu_item.attributes = params[:menu_item]
  8. @menu_item.save
  9. render nothing: true
  10. end
  11.  
  12. protected
  13.  
  14. def collection
  15. collection_variable_name = controller_name.gsub(/^/, '@').to_sym
  16. instance_variable_set(collection_variable_name, resource_class.rank(:row_order).all)
  17. end
  18. end
Add Comment
Please, Sign In to add comment