Hi CSN,
Any luck with a solution for this prob? I am facing the same problem
now?
Regards,
Sandeep G
CSN wrote:> Is there a quick and easy way to paginate something
> like @member.items (Member with has_many :items)?
> Right now I do in the controller:
>
> @item_pages, @member_items = paginate :item,
> :conditions=>["member_id=?", @member.id],
> :per_page=>25,
> :order=>''datetime desc''
>
> It''d be more DRY if this was possible:
>
> @item_pages, @member_items = paginate @member.items,
> :per_page=>25,
> :order=>''datetime desc''
>
> And even more so if it could all be done in the
> template:
>
> <% for item in @member.items(:limit=>25,
> :offset=>params[:page]*25) %>
> ...
> <% end %>
>
> <%= pagination_links @member.items, offset, limit, ...
> %>
>
>
> Any ideas?
>
> Thanks,
> csn
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---