# Episode 73 resulting in error: undefined method \`stringify\_keys!' for "33":String

**URL:** <https://www.ruby-forum.com/t/episode-73-resulting-in-error-undefined-method-stringify-keys-for-33-string/124641>\
**Category:** Rails\
**Created:** [December 31, 2007, 12:52pm UTC](https://www.ruby-forum.com/t/episode-73-resulting-in-error-undefined-method-stringify-keys-for-33-string/124641 "2007-12-31T12:52:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [December 31, 2007, 12:52pm UTC](https://www.ruby-forum.com/t/episode-73-resulting-in-error-undefined-method-stringify-keys-for-33-string/124641/1 "2007-12-31T12:52:37Z")

</div>

I’m working with a similar model in Episode 73, (my scenario is  
editing multiple pictures for a product using attachment\_fu).

And I’m getting an error when I try the technique suggested:

./views/admin/\_form.rhtml

\<% for picture in product.pictures %\>  
\<% fields\_for “product[picture\_attributes][]”, picture do |  
picture\_form| %\>  
Title: \<%= picture\_form.text\_field :title %\>  
\<% end %\>

./models/product.rb  
def picture\_attributes=(picture\_attributes)  
picture\_attributes.each do |attributes|  
pictures.build(attributes)  
end  
end

undefined method `stringify\_keys!’ for “33”:String

Parameters: {“commit”=\>“Edit”, “product”=\>{“image\_url”=\>“shep.jpg”,  
“price”=\>“400.00”, “title”=\>“German Shepard Lab Mix #2b”,  
“category\_ids”=\>[“6”],  
“picture\_attributes”=\>{“33”=\>{“title”=\>“asdf2”},  
“24”=\>{“title”=\>“asdf”}, “27”=\>{“title”=\>“asdf”},  
“30”=\>{“title”=\>“asdf”}}, “description”=\>“3 year old german shepard  
lab mix. Test!”}, “id”=\>“23”, “picture”=\>{“uploaded\_data”=\>""}}

I noticed in the video, it shows the “picture\_attributes” parameter as  
an array (not a hash is it shows on mine).

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [December 31, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/episode-73-resulting-in-error-undefined-method-stringify-keys-for-33-string/124641/2 "2007-12-31T13:24:14Z")

</div>

Hello,

Am Montag, 31. Dezember 2007 schrieb chovy:

> ```
> Title: <%= picture_form.text_field :title %>
> 
> ```
> 
> \<% end %\>

Try \<%= picture\_form.text\_field :title, :index=\> nil %\>  
as suggested in the episode.

Keep smiling  
yanosz

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [December 31, 2007, 2:29pm UTC](https://www.ruby-forum.com/t/episode-73-resulting-in-error-undefined-method-stringify-keys-for-33-string/124641/3 "2007-12-31T14:29:52Z")

</div>

On Dec 31, 3:52 am, chovy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> Title: <%= picture_form.text_field :title %>
> 
> ```
> 
> Parameters: {“commit”=\>“Edit”, “product”=\>{“image\_url”=\>“shep.jpg”,  
> “price”=\>“400.00”, “title”=\>“German Shepard Lab Mix #2b”,  
> “category\_ids”=\>[“6”],  
> “picture\_attributes”=\>{“33”=\>{“title”=\>“asdf2”},  
> “24”=\>{“title”=\>“asdf”}, “27”=\>{“title”=\>“asdf”},  
> “30”=\>{“title”=\>“asdf”}}, “description”=\>“3 year old german shepard  
> lab mix. Test!”}, “id”=\>“23”, “picture”=\>{“uploaded\_data”=\>“”}}
> 
> I noticed in the video, it shows the “picture\_attributes” parameter as  
> an array (not a hash is it shows on mine).

Nevermind, episode #75 had the solution 🙂
