Created
February 24, 2013 02:33
-
-
Save Mizpah/5022328 to your computer and use it in GitHub Desktop.
I have a page with around 60 objects. Using Kaminari to create pagination. The first page example is the existing page. Everything in one table, and the columns have a sort link in the header. Th recipie for this was taken from a tutorial and adapted. I note that line '4' was explained as being 'critical to stop things breaking'. The second exam…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index | |
@game_classes = GameClass.order("game_id").page(params[:page]).per(15) | |
@game_classes = GameClass.order(params[:sort]).page(params[:page]).per(15) if params[:sort] | |
#@game_classes = @game_classes.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @game_classes } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment