Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gem 'bcrypt', '~> 3.1.7'
- class UsersController < ApplicationController
- def create
- @user = User.new(user_params)
- if @user.save
- session[:user_id] = @user.id
- render json: @user, status: :created, location: @user
- else
- render json: @user.errors, status: :unprocessable_entity
- end
- end
- private
- def user_params
- params.require(:user).permit(:first_name, :last_name, :email, :password)
- end
- end
- ngOnInit() {
- this.Form = this.fb.group({
- first_name: this.fb.control(null, Validators.required),
- last_name: this.fb.control(null, Validators.required),
- email: this.fb.control(null, Validators.required),
- password: this.fb.control(null, Validators.required)
- });
- }
Add Comment
Please, Sign In to add comment