Suppose I have a classic blog application augmented with something like
restful authentication so that users must log in to create blog posts and to
issue comments on other blog posts.

I would like to give a user the option of deleting blog posts, but only
those that (s)he has created.

Do I put that logic in my Post model or in the controller?  Or does it go in
the User model?  Or should it go (somehow) in the session controller? In
principal, the Post model only knows about users to the extent that it
belongs_to :user.  It doesn't have any notion of who is currently logged in
-- that's the business of the session controller.  But the user views all of
the posts through the #index view of the session controller -- it seems very
logical to add a "Delete" link/icon next to the current user's posts in the
list.

I am curious to learn what other folks have done, and what your opinions are
on this issue.

Thanks for giving me the opportunity to ask :-)

--wpd

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

Reply via email to