Guest User

Untitled

a guest
Jun 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. module Extensions
  2. module ActsAsCustomResource
  3.  
  4. extend ActiveSupport::Concern
  5.  
  6. included do
  7.  
  8. inherit_resources
  9. respond_to :html, :xml, :json
  10.  
  11. define_method :collection do
  12. set_collection_ivar(end_of_association_chain.all.paginate(:page => params[:page], :per_page => 10))
  13. end
  14.  
  15. end
  16.  
  17. end
  18. end
Add Comment
Please, Sign In to add comment