Skip to content
Browse files

added option no_params for the special case where the resource_params…

… are not a hash
  • Loading branch information...
1 parent 75f3bbe commit c2e009669e3066852f81424bcb315c4d93d01fb7 Ace Suares committed Aug 12, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/cancan/controller_resource.rb
View
10 lib/cancan/controller_resource.rb
@@ -229,10 +229,14 @@ def name
end
def resource_params
- if @options[:class]
- @params[@options[:class].to_s.underscore.gsub('/', '_')]
+ if @options[:no_params]
+ {}
else
- @params[namespaced_name.to_s.underscore.gsub("/", "_")]
+ if @options[:class]
+ @params[@options[:class].to_s.underscore.gsub('/', '_')]
+ else
+ @params[namespaced_name.to_s.underscore.gsub("/", "_")]
+ end
end
end

0 comments on commit c2e0096

Please sign in to comment.
Something went wrong with that request. Please try again.