Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = User.new(:login => "bruce")
- user.password = user.password_confirmation = "wayne"
- user.save
- blog = Blog.new(:author => user, :title => "bruce's blog")
- blog.save
- 20.times do |i|
- blog.posts.create :author => user, :title => "posting #{i}", :content => "content"
- end
- collection = blog.posts
- collection.paginate 3
Add Comment
Please, Sign In to add comment