Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Paginate associations #101

Closed
laran opened this Issue · 2 comments

2 participants

@laran

I have a User model which has_many :transactions. Transaction belongs_to :user.

I would like to be able to do this:

User.find(params[:id]).transactions.paginate(:page => params[:page], :per_page => 20)

This doesn't seem currently doable. Is it?

@adamvaughan

I am using 3.0.pre2 and this works like a charm.

@event = Event.find(params[:id])

@posts = @event.posts.paginate(:page => params[:page], :per_page => 20)

@laran

It worked after I restarted my server. Loving how easy and unobtrusive it is.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.