File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ def paginate(collection)
23
23
24
24
base . class_eval do
25
25
def self . paginate ( options = { } )
26
- options . reverse_merge! ( per_page : 10 )
26
+ options . reverse_merge! ( :per_page => 10 )
27
27
params do
28
- optional :page , type : Integer , default : 1 ,
29
- desc : 'Page offset to fetch.'
30
- optional :per_page , type : Integer , default : options [ :per_page ] ,
31
- desc : 'Number of results to return per page.'
28
+ optional :page , :type => Integer , :default => 1 ,
29
+ :desc => 'Page of results to fetch.'
30
+ optional :per_page , :type => Integer , :default => options [ :per_page ] ,
31
+ :desc => 'Number of results to return per page.'
32
32
end
33
33
end
34
34
end
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ module Rails
5
5
def self . application
6
6
@application ||= begin
7
7
routes = ActionDispatch ::Routing ::RouteSet . new
8
- OpenStruct . new ( routes : routes , env_config : { } )
8
+ OpenStruct . new ( :routes => routes , :env_config => { } )
9
9
end
10
10
end
11
11
end
@@ -39,13 +39,13 @@ def teardown(*methods)
39
39
end
40
40
41
41
Rails . application . routes . draw do
42
- resources :numbers , only : [ :index ]
42
+ resources :numbers , :only => [ :index ]
43
43
end
44
44
45
45
class NumbersController < ActionController ::Base
46
46
include Rails . application . routes . url_helpers
47
47
48
- after_filter only : [ :index ] { paginate ( :numbers ) }
48
+ after_filter :only => [ :index ] { paginate ( :numbers ) }
49
49
50
50
def index
51
51
page = params . fetch ( :page , 1 ) . to_i
@@ -58,6 +58,6 @@ def index
58
58
end
59
59
60
60
@numbers = PaginatedSet . new ( page , 25 , total )
61
- render json : @numbers
61
+ render :json => @numbers
62
62
end
63
63
end
You can’t perform that action at this time.
0 commit comments