Module: RocketPants::JSONP::ClassMethods
- Defined in:
- lib/rocket_pants/controller/jsonp.rb
Instance Method Summary collapse
-
#jsonp(options = {}) ⇒ Object
Marks the current controller as supporting JSONP-style responses.
Instance Method Details
#jsonp(options = {}) ⇒ Object
Marks the current controller as supporting JSONP-style responses.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rocket_pants/controller/jsonp.rb', line 19 def jsonp( = {}) enable = .delete(:enable) { true } param = .delete(:parameter).try(:to_sym) if enable after_filter :wrap_response_in_jsonp, {:if => :jsonp_is_possible?}.reverse_merge() self._jsonp_parameter = param if param else skip_after_filter :wrap_response_in_jsonp, end end |