Hi, i''m trying to write a sort-of inbox feature for my app. e.g. having a ''inbox'' & ''sent items'' area for each logged in user so they can send and receive messages to people logged into the system. i''m thinking the data model would be something like... message user_id created_at updated_at something like that, the state (not read, read, sent) would determine what box it should sit in, sort of like a blog / list model to connect each message together like a line of history. unsure. any thoughts? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Griffiths wrote:> Hi, i''m trying to write a sort-of inbox feature for my app. > > e.g. > having a ''inbox'' & ''sent items'' area for each logged in user so they can > send and receive messages to people logged into the system. > > i''m thinking the data model would be something like... > > message > user_id > created_at > updated_at > > something like that, > > the state (not read, read, sent) would determine what box it should sit > in, sort of like a blog / list model to connect each message together > like a line of history. > > unsure. > > any thoughts?I seem to vaugely recall someone writing about a plugin doing that kind of thing. Maybe you can save yourself a bit of time browsing the plugin lists at: http://agilewebdevelopment.com/plugins And maybe me memory is corrupted and you should just go ahead and do it yourself. It sounds like a pretty easy task ;-) -- Cheers, - Jacob Atzen --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 7/31/07, John Griffiths <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, i''m trying to write a sort-of inbox feature for my app. > > e.g. > having a ''inbox'' & ''sent items'' area for each logged in user so they can > send and receive messages to people logged into the system. > > i''m thinking the data model would be something like... > > message > user_id > created_at > updated_at > > something like that, > > the state (not read, read, sent) would determine what box it should sit > in, sort of like a blog / list model to connect each message together > like a line of history. > > unsure. > > any thoughts?You may want sender/receiver fields too. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Rick, yep suppose I would, haven''t fully worked out then data model for this. as a sidenote, how do you write listboxes and checkboxes elements into the ruby forms? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''d probably add an Inbox model that belongs_to messages with a column for the user_id and read_state Then do a current_user.inbox.messages for your index find, and use group_by in the view to divide them up by state. This way a message can be ''delivered'' to multiple people with different states. A user deleteing a message removes it from his inbox. Then periodically purge all orphaned messages... (just thinking out loud here) linoj On Jul 31, 6:36 am, John Griffiths <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, i''m trying to write a sort-of inbox feature for my app. > > e.g. > having a ''inbox'' & ''sent items'' area for each logged in user so they can > send and receive messages to people logged into the system. > > i''m thinking the data model would be something like... > > message > user_id > created_at > updated_at > > something like that, > > the state (not read, read, sent) would determine what box it should sit > in, sort of like a blog / list model to connect each message together > like a line of history. > > unsure. > > any thoughts? > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---