app/controllers/users_controller.rb
# POST /signup
# return authenticated token upon signup
POST /signup
return authenticated token upon signup
POST / signup return authenticated token upon signup
def create
    user = User.create(user_params)
    if user.errors.any?
      errors = user.errors.full_messages.join(", ")
      render json: {message: Message.account_not_created(errors)}, status: :unprocessable_entity
    else
      auth_token = AuthenticateUser.new(user.email, user.password).call
      response = { message: Message.account_created, auth_token: auth_token }
      json_response(response, :created)
    end
  end
def create user = User . create ( user_params ) if user . errors . any? errors = user . errors . full_messages . join ( ", " ) render json : { message : Message . account_not_created ( errors ) } , status : :unprocessable_entity else auth_token = AuthenticateUser . new ( user . email , user . password ) . call response = { message : Message . account_created , auth_token : auth_token } json_response ( response , :created ) end end
POST /signup
return authenticated token upon signup
POST / signup return authenticated token upon signup