I have a proposal, though a bit hacky I'm afraid :)
class < ApplicationController
before_filter :disable_json
def disable_json
if request.format =~ /json/
//do something you like, redirect_to or reply with message
end
end
The before_filter will be fired before any specific controller's method.
The json header is usually "application/json"
For request
, you can read more here: http://guides.rubyonrails.org/action_controller_overview.html#the-request-object