limiting the Find method in the controller.

eg:

@user = User.find(:all, :limit => 2)


Hope it helps!



On Apr 21, 11:27 pm, Babos Catalin <li...@ruby-forum.com> wrote:
> I got a simple iteration going on
>
> <% @user.sender.each do |sender| %>
> ...
> <% end %>
>
> Can I fetch and display for example only 2 items from my database insted
> of all 4 of them  ?
>
> Is there a better way to do this ?
> I could use will_paginate on the iteration (per_page => 2) but I don`t
> want the links to show up.
>
> Cata
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to