Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 28, 2019 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaryKuz/3592909c9bde4e2cec56af5ee71b4725 to your computer and use it in GitHub Desktop.
Save MaryKuz/3592909c9bde4e2cec56af5ee71b4725 to your computer and use it in GitHub Desktop.
Create the controller users_controller.rb
class Api::UsersController < ApplicationController
private
def build_resource
@user = User.new resource_params
end
def resource
@user
end
def resource_params
params.require(:user).permit(:name, :email, :password, :password_confirmation)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment