# File lib/merb-extjs-direct/mixins/remoting_provider.rb, line 137 def handle_request(req) req = XRequest.new(req) begin # here's the Ext.direct.Transaction as a ruby Hash. # turn it into an offical ruby XRequest instance. # constantize the part-controller and send "action" to it. # NOTE: Extlib has nothing to do with ExtJS -- just a coincidence. Extlib is a Merb gem. return part(Extlib::Inflection.constantize(req.controller) => req.action, :xrequest => req) rescue XException => e # caught an XException...return an Ext.Direct-friendly XExceptionResponse return XExceptionResponse.new(req, e).to_json rescue StandardError => e # might be an invalid controller and/or action if we got here. # we can be more specific here and trap on NameError if we wish, intead of base StandardError return XExceptionResponse.new(req, e).to_json end end