Class: RuboCop::Cop::Betterment::RenderStatus
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Betterment::RenderStatus
- Extended by:
- AutoCorrector
- Includes:
- Utils::ResponseStatus
- Defined in:
- lib/rubocop/cop/betterment/render_status.rb
Constant Summary collapse
- MSG =
"Did you forget to specify an HTTP status code? The default is `status: :ok`, which might\nbe inappropriate in this situation. Rendering after a POST, PUT, PATCH or DELETE request\ntypically represents an error (e.g. `status: :unprocessable_entity`).\n".gsub(/\s+/, " ")
Constants included from Utils::ResponseStatus
Utils::ResponseStatus::UNSAFE_ACTIONS
Instance Method Summary collapse
Instance Method Details
#on_def(node) ⇒ Object
19 20 21 22 23 |
# File 'lib/rubocop/cop/betterment/render_status.rb', line 19 def on_def(node) each_offense(node, :render) do |responder| infer_status(responder) end end |