Class: Auth::Api::MesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/auth/api/mes_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



17
18
19
20
# File 'app/controllers/auth/api/mes_controller.rb', line 17

def destroy
  @user.destroy
  redirect_to api_me_url, notice: 'Me was successfully destroyed.'
end

#showObject



5
6
7
# File 'app/controllers/auth/api/mes_controller.rb', line 5

def show
  render json: @user.as_json(root: true, include: [:oauth_users], methods: [:avatar_url])
end

#updateObject



9
10
11
12
13
14
15
# File 'app/controllers/auth/api/mes_controller.rb', line 9

def update
  if @user.update(user_params)
    render json: @user.as_json(root: true, methods: [:avatar_url]), status: :created
  else
    process_errors(@user)
  end
end