Class: RemoteBootstrapModal::ModalResponder

Inherits:
ActionController::Responder
  • Object
show all
Defined in:
app/responders/remote_bootstrap_modal/modal_responder.rb

Instance Method Summary collapse

Instance Method Details

#default_render(*args) ⇒ Object



14
15
16
# File 'app/responders/remote_bootstrap_modal/modal_responder.rb', line 14

def default_render(*args)
  render(*args)
end

#redirect_to(options) ⇒ Object



18
19
20
21
22
23
24
# File 'app/responders/remote_bootstrap_modal/modal_responder.rb', line 18

def redirect_to(options)
  if request.xhr?
    head :ok, location: controller.url_for(options)
  else
    controller.redirect_to(options)
  end
end

#render(*args) ⇒ Object



6
7
8
9
10
11
12
# File 'app/responders/remote_bootstrap_modal/modal_responder.rb', line 6

def render(*args)
  options = args.extract_options!
  if request.xhr?
    options.merge! layout: modal_layout
  end
  controller.render *args, options
end