Ruby On Rails in UA Icon_home Главная Add to bookmarks Translate translate Profile Войти
Регистрация Форум Блоги Пользователи Список джемов Rails проекты      Поиск   

Ruby On Rails in UA/Программирование на ROR/Постраничная навигация/RE: Постраничная навигация

2008-06-08 14:38:22 Ответить  
admin
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+:

------------
Занимаюсь вебом и продвижением сайтов.
, ,
Назадназад Новыйновый Ответитьответить
Ключевые слова:
Гости: 185 Онлайн: TNemo,
Rambler's Top100
О проекте по всем вопросам обращайтесь на support
Rubyclub.com.ua Copyright © 2007 - 2008