Method: Motr::Controller::Responder#to_js
- Defined in:
- lib/motr/controller/responder.rb
#to_js ⇒ Object
Override to_js to set a X-Flash-Messages header to be utilized by an ajax response.
28 29 30 31 32 |
# File 'lib/motr/controller/responder.rb', line 28 def to_js flash = controller.flash.now controller.response['X-Flash-Messages'] = flash.to_json if [:success, :notice, :error].detect{ |key| flash[key].present? } defined?(super) ? super : to_format end |