Mar 5, 2009, 1:10:33 AM3/5/09
I'd like my /topics/ url to serve topics for the current user.
Primarily, it means:
* Fetch the collection/object relative to that current user
* Ensure that on create and update, the user hasn't tried to stuff the
topic into some other user's list
I was doing those with:
before_filter :fetch_topic, :except => [ :new, :create ]
before_filter :check_userid, :only => [ :create, :update ]
I'm now trying to switch to resource_controller, and I've defined
these methods to provide the parent object - so far, so good. The
fetch_topic() method is providing @user, btw, from
I'm suspecting that I need less of the before_filter stuff, but I'm
not sure how I cover the desired behavior without it - any help?
It's not clear to me that I've done everything I need to by defining
the two methods above. I would welcome any corrections on that or on
general stylistic recommendations.