Class: Kingsman::Controllers::Responder
- Inherits:
-
Jets::Controller::Responder
- Object
- Jets::Controller::Responder
- Kingsman::Controllers::Responder
- Defined in:
- lib/kingsman/controllers/responder.rb
Overview
Custom Responder to configure default statuses that only apply to Kingsman, and allow to integrate more easily with Hotwire/Turbo.
Class Method Summary collapse
-
.error_status ⇒ Object
TODO: remove this support for older Rails versions, which aren’t supported by Turbo and/or responders.
- .error_status= ⇒ Object
- .redirect_status ⇒ Object
- .redirect_status= ⇒ Object
Class Method Details
.error_status ⇒ Object
TODO: remove this support for older Rails versions, which aren’t supported by Turbo and/or responders. It won’t allow configuring a custom response, but it allows Kingsman to use these methods and defaults across the implementation more easily.
15 16 17 |
# File 'lib/kingsman/controllers/responder.rb', line 15 def self.error_status :ok end |
.error_status= ⇒ Object
23 24 25 26 |
# File 'lib/kingsman/controllers/responder.rb', line 23 def self.error_status=(*) warn "[KINGSMAN] Setting the error status on the Kingsman responder has no effect with this " \ "version of `responders`, please make sure you're using a newer version. Check the changelog for more info." end |
.redirect_status ⇒ Object
19 20 21 |
# File 'lib/kingsman/controllers/responder.rb', line 19 def self.redirect_status :found end |
.redirect_status= ⇒ Object
28 29 30 31 |
# File 'lib/kingsman/controllers/responder.rb', line 28 def self.redirect_status=(*) warn "[KINGSMAN] Setting the redirect status on the Kingsman responder has no effect with this " \ "version of `responders`, please make sure you're using a newer version. Check the changelog for more info." end |