Last active
November 3, 2022 11:11
-
-
Save yannvery/7463886 to your computer and use it in GitHub Desktop.
Revisions
-
yannvery revised this gist
Dec 10, 2013 . 8 changed files with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # Paginate with Kaminari without reload all data Use :remote => true option on link_to and paginate Region index page File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
yannvery revised this gist
Dec 10, 2013 . 7 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
yannvery revised this gist
Nov 14, 2013 . 7 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
yannvery revised this gist
Nov 14, 2013 . 5 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes.File renamed without changes. -
yannvery renamed this gist
Nov 14, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
yannvery created this gist
Nov 14, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ gem 'kaminari' This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ class PaginateRegionsController < ApplicationController def index @current_page = params[:page] @regions = Region.page(@current_page).per(10) end end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ <div class="row"> <div class="col-xs-12"> <div class="widget-box"> <div class="widget-title"> <span class="icon"> <i class="icon-screenshot"></i> </span> <h5>Regions</h5> </div> <div class="widget-content"> <div class="span6"><%= link_to 'New Region', new_region_path, :class => "btn btn-primary" %></div> </div> <div class="widget-content nopadding"> <table class="table table-bordered table-striped table-hover"> <thead> <tr> <th>Id</th> <th>Name</th> </tr> </thead> <tbody> <% @regions.each do |region| %> <tr> <td><%= region.id %></td> <td><%= link_to region.name, region %></td> </tr> <% end %> </tbody> </table> <%= link_to 'Previous', paginate_regions_path(:page => @regions.current_page - 1), :remote => true unless @regions.first_page? %> | <%= link_to 'Next', paginate_regions_path(:page => @regions.current_page + 1), :remote => true unless @regions.last_page? %> </div> </div> </div> </div> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ $('#regions').empty(); $('#regions').append('<%= escape_javascript(render partial: 'index') %>'); This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ class RegionsController < ApplicationController def index @current_page = 1 @regions = Region.page(@current_page).per(10) end end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <div id="content-header"> <h1>Regions</h1> </div> <div id="breadcrumb"> <%= link_to raw('<i class="icon-home"></i> Home'), root_path, :class => "tip-bottom", "data-original-title" => "Go to Home" %> <a href="#" class="current">Regions</a> </div> <div id="regions"> <%= render "paginate_regions/index" %> </div> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ resources :paginate_regions, :only => [:index]