Class: Extr::RouterController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/extr/router_controller.rb

Overview

Extr::RouterController is a standard Rails Action Controller that receives all incoming ExtJS requests (included validation of the transaction) and delegate them to the specified controller actions inside your Rails application.

Instance Method Summary collapse

Instance Method Details

#directObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/extr/router_controller.rb', line 14

def direct
 body = transactions.map(&:response)

 if request.form_data? and extjs_form_with_upload?
  render :inline => "<html><body><textarea>#{body.to_json}</textarea></body></html>", :content_type => 'text/html'
 else
  render :json => body ||= ""
 end
end