A workaround that I found was to explicitly state in controller
render :action 开发者_运维问答=> :some_action, :layout => false
otherwise JavaScript fails to work
Anyone found this problem or maybe something is wrong with my configuration...
it's a normal behaviour. How he know that you don't want render this layout ?
You can avoid the layout to all of your js format in add in your ApplicationController
Class ApplicationController
layout :no_in_js_format
def no_in_js_format
if request.format == :js
return nil
else
return 'application
end
end
end
Real solution: I had rhtml for layouts and rails was defaulting all templates to that layout. Once I renamed all rhtml to html.erb, it fixed the problem. Here is the article about this in detail: http://yehudakatz.com/2009/06/18/and-the-pending-tests-they-shall-pass/
精彩评论