Go Back   CodingForums.com > :: Server side development > Ruby & Ruby On Rails

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-16-2011, 03:12 PM   PM User | #1
noisyscanner
New Coder

 
Join Date: May 2009
Location: Glastonbury, UK
Posts: 53
Thanks: 1
Thanked 0 Times in 0 Posts
noisyscanner is an unknown quantity at this point
Merge three models for latest content on homepage?

Hey, guys!
I have three models for a blog here that I want to merge to find the latest content for the homepage.
  • Post
  • Picture
  • Video
To make this even more complicated would like to paginate the results using will_paginate.
What I have so far is this:
Code:
@posts = Post.paginate(:order => "created_at DESC", :page => params[:page])
Can anybody think of a solution?
Thanks,
Brad.
__________________
Bradley Reed

HTML5, CSS3, Ruby on Rails and PHP
http://www.universalgames.biz
http://www.joseandbrad.com
noisyscanner is offline   Reply With Quote
Reply

Bookmarks

Tags
merge models, pagination, rails

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:18 PM.


Advertisement
Log in to turn off these ads.