Method: Moonrope::DSL::ActionDSL#paginated
- Defined in:
- lib/moonrope/dsl/action_dsl.rb
#paginated(options = {}) ⇒ Object
Specify that this action will be returning paginated data. Sets up the parameters for the action as appropriate.
167 168 169 170 171 |
# File 'lib/moonrope/dsl/action_dsl.rb', line 167 def paginated( = {}) @action.traits << :paginated param :page, "The page number", :type => Integer, :required => true, :default => [:page] || 1 param :per_page, "The number of items to return per page", :type => Integer, :required => true, :default => [:per_page] || 30 end |