Fied paging

This commit is contained in:
Dan Elbert 2016-09-28 17:28:40 -05:00
parent 92b962e6b9
commit f7ab63e0d3
2 changed files with 5 additions and 3 deletions

View File

@ -7,6 +7,8 @@ class RecipesController < ApplicationController
# GET /recipes
def index
@criteria = ViewModels::RecipeCriteria.new(params[:criteria])
@criteria.page = params[:page]
@criteria.per = params[:per]
@recipes = Recipe.for_criteria(@criteria)
end

View File

@ -9,9 +9,9 @@
<p>No Recipes</p>
<% else %>
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %>
<%= link_to 'New Recipe', new_recipe_path, class: 'btn btn-default' %><br/>
<%= paginate @recipes, :param_name => 'criteria[page]' %>
<%= paginate @recipes %>
<div class="table-responsive">
<table class="recipe-table table table-striped table-hover">
@ -61,7 +61,7 @@
</table>
</div>
<%= paginate @recipes, :param_name => 'criteria[page]' %>
<%= paginate @recipes %>
<% end %>