# NoMethodError (undefined method \`save' for #\<HashWithIndifferentAccess:0x1032677e0\>

**URL:** <https://www.ruby-forum.com/t/nomethoderror-undefined-method-save-for-hashwithindifferentaccess-0x1032677e0/179382>\
**Category:** Ruby\
**Created:** [November 23, 2009, 11:00pm UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-save-for-hashwithindifferentaccess-0x1032677e0/179382 "2009-11-23T23:00:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/47e85d/32.png) [@miles](https://www.ruby-forum.com/u/miles)\
**Post date:** [November 23, 2009, 11:00pm UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-save-for-hashwithindifferentaccess-0x1032677e0/179382/1 "2009-11-23T23:00:57Z")

</div>

Hello-  
I’m sending an object to RubyAMF from Actionscript, and getting an  
unexpected error that I can’t figure out. Here’s what it looks like:

===========

Processing AmfsearchesController#save (for 127.0.0.1 at 2009-11-23  
13:46:26) [POST]  
Parameters: {0=\>{“city”=\>“southeast alaska”, “active”=\>false}}

NoMethodError (undefined method `save' for #<HashWithIndifferentAccess: 0x1032677e0>): app/controllers/amfsearches_controller.rb:25:in`save’  
app/controllers/amfsearches\_controller.rb:21:in `save' vendor/plugins/rubyamf/app/actions.rb:139:in`invoke’  
vendor/plugins/rubyamf/app/actions.rb:86:in `run' vendor/plugins/rubyamf/app/filters.rb:68:in`run’  
vendor/plugins/rubyamf/app/filters.rb:68:in `run' vendor/plugins/rubyamf/app/filters.rb:65:in`each’  
vendor/plugins/rubyamf/app/filters.rb:65:in `run' vendor/plugins/rubyamf/app/filters.rb:63:in`upto’  
vendor/plugins/rubyamf/app/filters.rb:63:in `run' vendor/plugins/rubyamf/app/filters.rb:12:in`run’  
vendor/plugins/rubyamf/app/filters.rb:11:in `each' vendor/plugins/rubyamf/app/filters.rb:11:in`run’  
vendor/plugins/rubyamf/app/rails\_gateway.rb:28:in `service' app/controllers/rubyamf_controller.rb:16:in`gateway’

===========

So at the beginning there you can see the parameters are there, but it  
looks like it can’ convert the object. Here’s the ‘save’ method:

===========

# saves new or updates existing Amfsearch

# expect params[0] to be incoming Amfsearch

def save  
respond\_to do |format|  
format.amf do  
@amfsearch = params[0]

```
    if @amfsearch.save
      render :amf => @amfsearch
    else
      render :amf => FaultObject.new

```

(@amfsearch.errors.full\_messages.join(’\n’))  
end  
end  
end  
end

===========

Any ideas? I greatly appreciate it.  
Thanks!

---

<div class="post-metadata">

**Author:** ![miles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/47e85d/32.png) [@miles](https://www.ruby-forum.com/u/miles)\
**Post date:** [December 15, 2009, 3:21pm UTC](https://www.ruby-forum.com/t/nomethoderror-undefined-method-save-for-hashwithindifferentaccess-0x1032677e0/179382/2 "2009-12-15T15:21:09Z")

</div>

in actionScript  
add  
[RemoteClass(alias=‘br.moss.air.model.AnimalDimension’)]  
[Bindable]

where br.moss.air.model.AnimalDimension is the name of your class as  
defined in  
rubyamf\_config.rb

as for exemple:  
ClassMappings.register(  
:actionscript =\> ‘br.moss.air.model.AnimalDimension’,  
:ruby =\> ‘AnimalDimension’,  
:type =\> ‘active\_record’,  
:attributes =\> [“id”, “raca”, “especie”, “sexo”])

[]s  
Bhola
