load collection resources in custom controller actions with no id param - closes #296

This commit is contained in:
Ryan Bates
2011-03-08 16:10:40 -08:00
parent ba999970b1
commit 37102fe6f8
3 changed files with 17 additions and 8 deletions

View File

@@ -113,7 +113,7 @@ module CanCan
end
def member_action?
!collection_actions.include? @params[:action].to_sym
new_actions.include?(@params[:action].to_sym) || (@params[:id] && !collection_actions.include?(@params[:action].to_sym))
end
# Returns the class used for this resource. This can be overriden by the :class option.