Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#4246

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. ( http://j.mp/aFHyu4 )

the error output:

NoMethodError (undefined method `html_safe' for ["alert(\"foo! 
\");"]:Array):

we don't really know why the result is an array and not a string,
please also see the discussion in the haml list
http://groups.google.com/group/haml/browse_thread/thread/89593b0fdb...

Reported by z3cko · March 21st, 2010 @ 07:39 PM

State: invalid
Milestone: 3.0.2
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: Low

Activity

  1. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • 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.

    March 27th, 2010 @ 08:32 AM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM