I have a number of resources (Trips, Schedules, etc) with actions that should be limited to just the resource\'s owner.
How do you implement code with a #require_ow
Or just use inherited resources:
InheritedResources also introduces another method called begin_of_association_chain. It’s mostly used when you want to create resources based on the @current_user and you have urls like “account/projects”. In such cases you have to do @current_user.projects.find or @current_user.projects.build in your actions.
You can deal with it just by doing:
class ProjectsController < InheritedResources::Base
protected
def begin_of_association_chain
@current_user
end
end