I\'m trying to write a Rails controller method that will respond to get requests made both \"normally\" (e.g. following a link) and via ajax.
Normal Case: The controller
In your controller dynamically select whether to use a layout based on request.xhr?.
request.xhr?
For example:
class SomeController < ApplicationController layout :get_layout protected def get_layout request.xhr? ? nil : 'normal_layout' end end