Created
August 9, 2011 05:09
-
-
Save wyanez/1133445 to your computer and use it in GitHub Desktop.
[Rails] Instalación y uso de Will_Paginate
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 characters
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