Class: Rad::Web::Processors::AjaxHelper
- Inherits:
-
Conveyors::Processor
- Object
- Conveyors::Processor
- Rad::Web::Processors::AjaxHelper
- Defined in:
- lib/rad/web/_ajax_helper.rb
Overview
Sets format for :js as :html and wraps body into <textarea> Forms with files can be submitted by ajax only via iframe, and it requires the response have ‘html’ encoding and be wrapped into <textarea>
Instance Attribute Summary
Attributes inherited from Conveyors::Processor
Instance Method Summary collapse
Methods inherited from Conveyors::Processor
Constructor Details
This class inherits a constructor from Rad::Conveyors::Processor
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/rad/web/_ajax_helper.rb', line 5 def call response = workspace.response.must_be.defined request = workspace.request.must_be.defined next_processor.call if workspace.params? and workspace.params.format == 'js' and !request.xhr? response.content_type = Mime['html'] workspace.content = "<textarea>#{workspace.content}</textarea>" end end |