Class: Tally::KeysController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tally/keys_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/tally/keys_controller.rb', line 4

def index
  records = search.keys.page(params[:page]).per(params[:per_page] || 24).without_count

  render json: {
    keys: records.map(&:key),
    meta: {
      next_page: records.next_page,
      current_page: records.current_page,
      previous_page: records.prev_page,
      per_page: records.limit_value
    }
  }
end