Welcome to the Treehouse Community
Looking to learn something new?
Public vs. Private Status'
I've been working on extending the Treebook application and one of the concepts I've added is a flag on the status to either make the status a 'public' i.e. seen by other users or 'private' status only seen by the current user.
Right now I make this check in the status index view with this code
<% if status.visable == true || status.user_id == current_user.id %>
I'm pretty sure this violates the DRY principle though as there maybe other pages where you want to a list of status so I would assume you that you would want to move this to a method and call that method in the status controller in the index method however, after many hours on Google I haven't found a way that works.
Brandon Barrette20,485 Points
What's your question? I'm not sure I understand the issue you're having.