Permalink
Browse files

search object attributes in params[resource_instance_name] if they pa…

…rams[resource_request_name] empty
  • Loading branch information...
lda authored and josevalim committed Jan 26, 2011
1 parent 7da7d23 commit a6ada355d9314dcf6222bf477a103683770b47c1
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/inherited_resources/actions.rb
  2. +1 −1 lib/inherited_resources/base_helpers.rb
@@ -42,7 +42,7 @@ def create(options={}, &block)
def update(options={}, &block)
object = resource
if update_resource(object, params[resource_request_name])
if update_resource(object, params[resource_request_name] || params[resource_instance_name])
options[:location] ||= smart_resource_url
end
@@ -49,7 +49,7 @@ def resource
# instance variable.
#
def build_resource
get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_build, params[resource_request_name] || {}))
get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_build, params[resource_request_name] || params[resource_instance_name] || {}))
end
# Responsible for saving the resource on :create method. Overwriting this

0 comments on commit a6ada35

Please sign in to comment.