On 7.10.2005, at 5.06, Luke wrote:
> Hi,
>
> I''ve had a good look through the APIs, Rails wiki and Agile
> Development book,
> but haven''t yet discovered how to do something that I imagine is
> quite simple !!
> .. I have a database with over 1000 messages that I am paginating,
> so I''d like
> to change the default ''1 2 3 ... 114'' pagination links
that are
> generated to
> something like ''1 2 3 4 5 6 7 8 9 10 12 12 ... 114''
There is a parameter called window_size in the pagination_links
helper [1].
> . I''d also like to add
> ''Previous'' and ''Next'' links to go back
or forwards one page.
I think pagination_links does that but am not quite sure. Anyways,
there''s an example of how to do this manually with link_to on that
same API doc page [1].
> And lastly, though
> this isn''t critical, I''d like to change the
''page'' variable to
> another word!
See the :name parameter of pagination_links [1]. In order for the
paginator to understand that you use a different word for it, you
also need to set the :parameter option of paginate call to whatever
word you use. It''s in the DEFAULT_OPTIONS hash of Pagination API docs
[2].
//jarkko
[1] http://rails.rubyonrails.com/classes/ActionView/Helpers/
PaginationHelper.html#M000322
[2] http://rails.rubyonrails.com/classes/ActionController/
Pagination.html
--
Jarkko Laine
http://jlaine.net
http://odesign.fi
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails