What does the code below’s :layout do?
respond_with( @comment, :layout => !request.xhr? )
The code above is handling rendering of the different MIME type based on request data type (If my understanding is correct).
What is the :layout tag doing?
From the documentation for ActionController::Responder
So what the
:layout => !request.xhr?it will pass this option down to the rendering. So if you had an HTML resource called as a regular request, it would use the standard layout, but an HTML request made as anXmlHttpRequestwould not use a layout