On Jan 10, 2014, at 6:13 PM, Robert Jewell wrote: > Hey Walter, > > Your advice is really solid, and I appreciate it a lot. Thank you for > pointing out the note about pluralization. I fixed it accordingly. > However, I not follow you so well here: > >> On Jan 9, 2014, at 10:55 AM, Robert Jewell wrote: > >> This would be the proper inverse of the previous suggestion... >> Actually, reading through this twice before sending, I think the best >> thing for you to do is read this page: >> >> http://guides.rubyonrails.org/association_basics.html >> >> ...paying particular attention to this: >> > http://guides.rubyonrails.org/association_basics.html#bi-directional-associations >> > > Moreover, I am not too sure if what I have done has further complicated > things :-) > > I am trying to create a notifications center for my users to see their > project requests and private messages -- as well as any other related > activity in our community. There is a lot to see here with regards to my > application's file structure, and I would like to show you the repo. > However, its private, and I do not know how to let someone just view it. > > I created a gist for you to see what I've done for the following tables > and models: PrivateMessage, User and Notification: > https://gist.github.com/rjewell2200/8364291
One thing leaps out at me here: I don't think you really want to make the first and last name unique -- anyone named Smith in your system? Any others? > > Also, here are the relevant routes: > https://gist.github.com/rjewell2200/8364263 > > and the routes.rb file: https://gist.github.com/rjewell2200/8364354 > > I've also created a model backed form to hit the database each time that > a user goes to another user's profile to send the recipient a message. > While each POST is adding rows to the notifications table, all of the > attributes of the notifications table are showing up as, nil. Here's the > gist for file containing the form: > https://gist.github.com/rjewell2200/8364382 It might be instructional for you to post the controller that handles this form, I don't see anything wrong here, except unless you are adding the sender_uid in that controller, I don't see it being added to the params in the form anywhere. > > Basically I think I've wired up everything correctly but every time I go > to another users profile to send him/her a message, I can not view those > notifications on the UI/UX and yet the model backed form is hitting the > notifications database, although the notifications table's rows are not > showing any of the rows attributes. > > Can you guess why my polymorphic, notifications table is not receiving > the attributes from the submitted private messages? Also, each POST > fails to hit the private_messages tables as well. I think you may be missing something in the controller then, that's the only thing I haven't seen yet, and everything so far has seemed reasonable. Walter > > -- > 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 unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscr...@googlegroups.com. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/adc9cfb81c2dd11fab9b5db2925e4856%40ruby-forum.com. > For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0EA30975-59C0-43B0-A5CD-5F5FFEA527B2%40wdstudio.com. For more options, visit https://groups.google.com/groups/opt_out.