[Rails] Re: Re: Re: Different Order by clause on will_paginate pages?
> And then your index.html.erb would be exactly the same as it currently
> is, with the pagination and whatnot, and your index (controller) method
> would also be the same, with no worries about making the pagination
> smarter. Wherever you wanted your random sample to appear, you would
> simply use the sample method. And your index would be a normal index
> without any notion of randomness, so any possible foo could be shown or
> found.
Thanks Walter, i appreciate your efforts, i understand your point here,
but what you are saying is to have two separate things, my point is to
show random items with pagination, we can show random items as shown
above but we cannot accommodate this thing with our overall pagination,
e.g
def index
@foo = Foo.order('created_at Desc').paginate :page => params[:page],
:per_page => @per_page
end
As u are saying this would remain the same but my point is that we have
to accommodate that random sample method in the first page rather than
to have it separate from pagination. As in the above index method how
can we pass sample in it just for first page?
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home