Module: Ajax::ActionView::Helpers

Defined in:
lib/ajax/action_view.rb

Instance Method Summary collapse

Instance Method Details

#ajax_header(key, value) ⇒ Object

Set a custom response header if the request is AJAX.



13
14
15
16
# File 'lib/ajax/action_view.rb', line 13

def ajax_header(key, value)
  return unless Ajax.is_enabled? && request.xhr?
  Ajax.set_header(response, key, value)
end