Sha256: b9f3dd530474bca8f396cb4ca619e69a5fec132ba533dd1359048ce983d5db2a

Contents?: true

Size: 323 Bytes

Versions: 2

Compression:

Stored size: 323 Bytes

Contents

module JTable
  module ActionController
    def jtable_for_json(rel, jtable_params)
      jtable_params = HashWithIndifferentAccess.new(jtable_params)
      items = rel.jtable_paginate(jtable_params[:limit], jtable_params[:offset])
      {:total_items => rel.count, :items => items.collect(&:jtable_item)}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jtable-rails-0.1.4 lib/jtable-rails/action_controller.rb
jtable-rails-0.1.3 lib/jtable-rails/action_controller.rb