Class: Devise::JWT::BaseController

Inherits:
ApplicationController
  • Object
show all
Includes:
ActionController::MimeResponds
Defined in:
app/controllers/devise/jwt/base_controller.rb

Instance Method Summary collapse

Instance Method Details

#respond_to_on_destroyObject



14
15
16
# File 'app/controllers/devise/jwt/base_controller.rb', line 14

def respond_to_on_destroy
  head :no_content
end

#respond_to_removed_actionObject



18
19
20
# File 'app/controllers/devise/jwt/base_controller.rb', line 18

def respond_to_removed_action
  head :not_found
end

#respond_with(resource, _opts = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'app/controllers/devise/jwt/base_controller.rb', line 6

def respond_with(resource, _opts = {})
  if resource.valid?
    render json: resource, status: :created
  else
    render json: resource.errors, status: :unprocessable_entity
  end
end