That’s basically it. I want most of the views in my Ruby on Rails 3.1 app to be rendered without layout, as they will be assigned to divs by jQuery, but I don’t want to go to every controller action and set render :layout => false in the respond_to block.
Is it possible to change the default rendering of views to :layout => false? How would I go about configuring that?
Thank you for your help
EDIT
I could also solve it with a way to have something along the lines of:
if request.xhr?
format.html { render :layout => false }
end
be executed on every respond_to block.
If you want some more advanced behavior (such as determine de layaout in execution time) you also can pass a block that returns nil or a valid layout name: