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 method, simply do this:
respond_to do |format| format.js if request.xhr? format.html { redirect_to :action => "index"} end