Class: Toker::UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/toker/users_controller.rb

Instance Method Summary collapse

Methods included from TokenAuthentication

#current_user, #toke!

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
# File 'app/controllers/toker/users_controller.rb', line 7

def create
  user = User.new(person_params)
  if user.save
    render json: user, status: 201
  else
    head 500
  end
end

#indexObject



16
17
18
# File 'app/controllers/toker/users_controller.rb', line 16

def index
  render json: User.all
end

#showObject



20
21
22
23
# File 'app/controllers/toker/users_controller.rb', line 20

def show
  user = User.find(params[:id])
  render json: user
end