Skip to content

Instantly share code, notes, and snippets.

@wyanez
Created August 9, 2011 05:09
Show Gist options
  • Save wyanez/1133445 to your computer and use it in GitHub Desktop.
Save wyanez/1133445 to your computer and use it in GitHub Desktop.
[Rails] Instalación y uso de Will_Paginate
1)Modificamos el config/environment.rb:
Rails::Initializer.run do |config|
config.gem 'will_paginate', :version => '~> 2.3.15', :source => 'http://gemcutter.org'
2) en el controlador:
@arrDatos = Modelo.paginate(:all, :per_page =>10, :page => params[:page])
3) en la vista:
<%= will_paginate @arrDatos, :prev_label => '<<Anterior', :next_label => 'Siguiente>>' %>
4) rake gems::install
https://github.com/mislav/will_paginate/wiki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment