2012-07-31 08:35:27 +01:00
|
|
|
# -*- encoding : utf-8 -*-
|
|
|
|
class Api::V1::BaseController < ApplicationController
|
2012-09-26 18:15:11 +01:00
|
|
|
|
2012-08-31 13:23:44 +01:00
|
|
|
before_filter :restrict_paginate, :only => :index
|
2012-09-26 18:15:11 +01:00
|
|
|
#respond_to :json
|
2012-08-31 13:23:44 +01:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def restrict_paginate
|
|
|
|
params[:per_page] = 30 if params[:per_page].blank? or params[:per_page].to_i < 1
|
|
|
|
params[:per_page] = 100 if params[:per_page].to_i >100
|
|
|
|
end
|
2012-09-21 20:15:48 +01:00
|
|
|
|
2012-07-31 08:35:27 +01:00
|
|
|
end
|