Class: RailsStuff::ResourcesController::Responder
- Inherits:
-
ActionController::Responder
- Object
- ActionController::Responder
- RailsStuff::ResourcesController::Responder
- Includes:
- Responders::FlashResponder, Responders::HttpCacheResponder
- Defined in:
- lib/rails_stuff/resources_controller/responder.rb
Overview
Default responder class.
Instance Method Summary collapse
-
#to_js ⇒ Object
Similar to ‘.to_html`.
Instance Method Details
#to_js ⇒ Object
Similar to ‘.to_html`. Redirect is performed via turbolinks.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rails_stuff/resources_controller/responder.rb', line 9 def to_js default_render rescue ActionView::MissingTemplate raise if get? if has_errors? render resource.persisted? ? :edit : :new else redirect_via_turbolinks_to controller.url_for(resource_location) end end |