On 2 Oct 2008, at 01:05, DanC wrote:

>
> I set up a simple blog in my rails app and on the forum index page
> would like to display when the most recent activity was.
>
> I have two table in my database, one for posts and the other for
> replies.
>
> My question is, how can I compare the created_at tags for two
> different models?
>
> I need some sort of conditional statement like
>
> <% if forum.topic.last.created_at  < forum.replies.last.created_at %>
>
>
Something like that is fine. What's stopping you from going ahead and  
doing that ?

Fred
> and then display the most recent activity.
>
> Any ideas much appreciated,
>
> Dan
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to