| 2008-06-08 14:38:22 | Ответить |
|---|---|
|
Ruslan Voloshin Адрес: odessa Сообщений: 1231 Регистр: 2007-03-13 его блог 40 сообщ. |
RE: Постраничная навигация |
|
да тебе ого надо подключить в моделе
------------
А ты говорил что сделал все по мануалу script/plugin install svn://errtheblog.com/svn/plugins/will_paginate Выдержка из README == Example usage: Use a paginate finder in the controller: Yeah, +paginate+ works just like +find+ -- it just doesn't fetch all the records. Don't forget to tell it which page you want, or it will complain! Read more on WillPaginate::Finder::ClassMethods. Render the posts in your view like you would normally do. When you need to render pagination, just stick this in: You're done. (Copy and paste the example fancy CSS styles from the bottom.) You can find the option list at WillPaginate::ViewHelpers. How does it know how much items to fetch per page? It asks your model by calling +Post.per_page+. You can define it like this: ... or don't worry about it at all. (WillPaginate defines it to be 30 if missing.) You can also specify the count explicitly when calling +paginate+: Занимаюсь вебом и продвижением сайтов.
|
|
| cattr_reader, per_page, will_paginate |