Forum: Ruby on Rails undefined method `has_key?'

87768988ca831c7c84300c9751c25f04?d=identicon&s=25 Michael Gao (hashman)
on 2009-10-23 07:07
I update rails from 2.0.2 to 2.2.3, the line below can work at old
version but report error at new version

<%= render_partial "_jsdatacombo" %>

the error is:

undefined method `has_key?' for "_jsdatacombo":String

It seemed if I user render_partial function, the system always report
the error.

Any has ideas?
96146b7a23174e2e024c06a49f845bb8?d=identicon&s=25 Jeffrey L. Taylor (Guest)
on 2009-10-23 08:18
(Received via mailing list)
Quoting Michael Gao <rails-mailing-list@andreas-s.net>:
>
> I update rails from 2.0.2 to 2.2.3, the line below can work at old
> version but report error at new version
>
> <%= render_partial "_jsdatacombo" %>
>

render_partial is obsolete.  Use <%= render :partial => 'jsdatacombo' %>

(Rails will insert the underscore on the front of the name,
automagically.)

HTH,
  Jeffrey
87768988ca831c7c84300c9751c25f04?d=identicon&s=25 Michael Gao (hashman)
on 2009-10-23 08:50
Jeffrey L. Taylor wrote:
> Quoting Michael Gao <rails-mailing-list@andreas-s.net>:
>>
>> I update rails from 2.0.2 to 2.2.3, the line below can work at old
>> version but report error at new version
>>
>> <%= render_partial "_jsdatacombo" %>
>>
>
> render_partial is obsolete.  Use <%= render :partial => 'jsdatacombo' %>
>
> (Rails will insert the underscore on the front of the name,
> automagically.)
>
> HTH,
>   Jeffrey

Ok, it work, thanks
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.