Fied paging
This commit is contained in:
parent
92b962e6b9
commit
f7ab63e0d3
@ -7,6 +7,8 @@ class RecipesController < ApplicationController
|
|||||||
# GET /recipes
|
# GET /recipes
|
||||||
def index
|
def index
|
||||||
@criteria = ViewModels::RecipeCriteria.new(params[:criteria])
|
@criteria = ViewModels::RecipeCriteria.new(params[:criteria])
|
||||||
|
@criteria.page = params[:page]
|
||||||
|
@criteria.per = params[:per]
|
||||||
@recipes = Recipe.for_criteria(@criteria)
|
@recipes = Recipe.for_criteria(@criteria)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
<p>No Recipes</p>
|
<p>No Recipes</p>
|
||||||
<% else %>
|
<% 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">
|
<div class="table-responsive">
|
||||||
<table class="recipe-table table table-striped table-hover">
|
<table class="recipe-table table table-striped table-hover">
|
||||||
@ -61,7 +61,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= paginate @recipes, :param_name => 'criteria[page]' %>
|
<%= paginate @recipes %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user