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.

Js.erb templates broken in 2.3.0 RC1?

#2022

js.erb templates seem to be broken in 2.3.0 RC1. Is this a known issue?

Controller (controllers/posts_controller.rb)


def create
  …
  respond_to do |format|
    format.js
  end
end

View (views/posts/create.js.erb)


alert("the js.erb template is working!");

When I fire the Ajax.Request to /posts I don't get the js alert dialog specified in create.js.erb. I don't get any errors or warnings in the server log. But if I look at the ajax response (with Firebug) I'm basically getting back the whole html layout template...

Reported by zeno · February 19th, 2009 @ 08:40 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. zeno
    zeno

    hmmm, some "evolutions": it seems to work if I specify render :layout => false :

    
    def create
      …
      respond_to do |format|
        format.js { render :layout => false }
      end
    end
    

    February 19th, 2009 @ 08:48 PM

  2. josh
    josh
    • Assigned user set to josh
    • State changed from new to duplicate
    • Milestone cleared.

    I believe this issue already came up and was fixed on master. If you could please try again on edge and let me know if your still having any problems.

    February 20th, 2009 @ 02:46 AM

  3. zeno
    zeno

    Joshua, I'd like to try it on edge, but I can't even start mongrel with the latest revision (9702636a08e50e9fed9bf76ad620a6a0a109009e) because of a cookie_store/session error...

    Apparently other users have the same issue (see Thibaud's comment here: #2001 Rails 2.3 does not obey config.action_controller.session_store )

    February 20th, 2009 @ 08:24 AM

  4. josh
    josh
    • State changed from duplicate to open

    February 20th, 2009 @ 04:24 PM

  5. josh
    josh

    Sorry, that issue was just fixed. Please try once again.

    February 20th, 2009 @ 05:05 PM

  6. zeno
    zeno

    Thanks Joshua,

    I could finally test this issue (js.erb templates) with the latest edge revision, and yes, I confirm it has been fixed: js.erb templates are working great out-of-the-box

    thanks z

    February 21st, 2009 @ 12:16 AM

  7. josh
    josh
    • State changed from open to resolved

    February 21st, 2009 @ 02:53 AM

  8. ben
    ben
    • Tag changed from 2.3-rc1, javascript, render, template to javascript, render, template
    • Assigned user cleared.

    sorry if it is out of topic,
    but still, found out through those comments how to but,
    working currently with 2.3.4 rails version and jquery,
    had to put the render :layout => false in the format.js
    to make my .js.erb templates working (and took forever to get this page to be noticed... ;) ).

    November 2nd, 2009 @ 06:49 PM

  9. Ryan Bigg
    Ryan Bigg
    • Tag cleared.
    • Importance changed from to Low

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:57 PM