Hi Yusuke,
This looks like a general Rails question. Please ask this question on the
rubyonrails-talk mailing list. This list is reserved for core Rails discussion.
Thanks!
On Tuesday, 3 July 2012 at 6:42 AM, Yusuke Enomoto wrote:
> Hello.I have a question. I am making chat application to practice RoR.
>
> I have three models. User, Chat, and Message.
> The relationship is that User has many chats(it means chat''s host)
and many message,s Chat has many messages.
>
> Now I want to create a lobby page like this.
> http://freezing-sword-4391.herokuapp.com/chat/lobby
>
> This page shows all chats sorted by the last message''s created_at.
each chat shows who is chat''s host, and what the last message is.
>
> Is there any good way to get resource by ActiveRecord''s method?
>
> Besides, the amount of messages will be huge,so is there good way to get
all chats which have the last message by loading LIMIT 1 message?
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
> To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-core/-/QCCP2lRcoKUJ.
> To post to this group, send email to rubyonrails-core@googlegroups.com
(mailto:rubyonrails-core@googlegroups.com).
> To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com
(mailto:rubyonrails-core+unsubscribe@googlegroups.com).
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en.