Rails not choosing the right layout for javascript requests
问题 I have two different layouts in my app, one for javascript (AJAX) requests and one for regular requests. # application.html.haml for non-js requests (abbreviated) !!! %html %head %body = yield # and application.js.coffee for js requests App.modal """<%= yield %>""" # creates a javascript modal Any link with :remote => true should in theory use the javascript layout. This DOES work on certain occasions, but does not work on others. It works for this link: %li= link_to "Login", new_user_session