# Undefined method \`stringify\_keys!' for "4":String - Meaning

**URL:** <https://www.ruby-forum.com/t/undefined-method-stringify-keys-for-4-string-meaning/76758>\
**Category:** Rails\
**Created:** [November 20, 2006, 11:10pm UTC](https://www.ruby-forum.com/t/undefined-method-stringify-keys-for-4-string-meaning/76758 "2006-11-20T23:10:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@rudy](https://www.ruby-forum.com/u/rudy)\
**Post date:** [November 20, 2006, 11:10pm UTC](https://www.ruby-forum.com/t/undefined-method-stringify-keys-for-4-string-meaning/76758/1 "2006-11-20T23:10:33Z")

</div>

Hi, I have the following on a view

\<% for evaluation in @evaluations %\>

\<%=h evaluation[0].name %\>  
\<%=evaluation[1].object\_id %\>  
\<%= link\_to( “Start”, :action =\>‘evaluatie’, :id =\>  
evaluation[1].object\_id) %\>  
\<%end%\>

When I click on the link, I can see that I do get a Parameters:  
{“id”=\>“4”} request.

In my controller I just have

def evaluatie  
idee = Evaluation.new(params[:id])  
@ideename= idee.name  
end

For some reason, I get the message “undefined method  
`stringify\_keys!’ for “4”:String”  
Can anyone explains what that means? It is the first time I encounter  
this.  
Many thanks for any reply.

---

<div class="post-metadata">

**Author:** ![rudy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@rudy](https://www.ruby-forum.com/u/rudy)\
**Post date:** [November 22, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/undefined-method-stringify-keys-for-4-string-meaning/76758/2 "2006-11-22T19:01:25Z")

</div>

On Nov 20, 2006, at 4:36 PM, Rudy wrote:

> {“id”=\>“4”} request.  
> Can anyone explains what that means? It is the first time I encounter  
> this.  
> Many thanks for any reply.

If you’re using ActiveRecord, then you probably meant to use .id  
rather than .object\_id (and the fact that nil.object\_id == 4 is  
pointing toward another error).

Evaluation.new expects to have an attribute hash and your params[:id]  
is just “4” which is the object\_id of nil meaning evaluation[1] is  
nil and evaluation is coming from the Enumerable @evaluations. Using  
[1] on it appears to indicate that it is an Array or some other type  
that provides an array-like accessor using the [] method.

I suspect that you could use a good, basic tutorial (or a book) on  
Rails. I’m sure Google will help with that search.

-Rob

Rob B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
