This project is archived and is in readonly mode.

#4246 ✓invalid

possible format.js error in rails master (actioncontroller issues) returning array and not string

Reported by z3cko | March 21st, 2010 @ 07:39 PM | in 3.0.2

there is a discussion on the haml group which i started, which is related to responses when rendering js with rails3.

to reproduce:

1) create a link_to @foo, :remote => true
2) create a js responder in the controller: format.js { render :update do |p| p.reload end}
3) see the output in the patched and in the unpatched version. ( )

the error output:

NoMethodError (undefined method `html_safe' for ["alert(\"foo! 

we don't really know why the result is an array and not a string,
please also see the discussion in the haml list

Comments and changes to this ticket

  • Yehuda Katz (wycats)

    Yehuda Katz (wycats) March 27th, 2010 @ 08:32 AM

    • State changed from “new” to “invalid”
    • Tag changed from action_controller, html_safe, rails3 to action_controller, haml, html_safe, rails3
    • Assigned user set to “Yehuda Katz (wycats)”
    • Milestone cleared.

    Unfortunately, RJS can return Arrays in some cases. At some point, we'll revisit the RJS issue, but for now, Haml should handle Array output.

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
    • Importance changed from “” to “Low”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket