daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Apr 26th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. gem 'bcrypt', '~> 3.1.7'
  2.    
  3. class UsersController < ApplicationController
  4.  
  5.     def create
  6.         @user = User.new(user_params)
  7.  
  8.         if @user.save
  9.             session[:user_id] = @user.id
  10.             render json: @user, status: :created, location: @user
  11.         else
  12.             render json: @user.errors, status: :unprocessable_entity
  13.         end
  14.     end
  15.  
  16.     private
  17.     def user_params
  18.         params.require(:user).permit(:first_name, :last_name, :email, :password)
  19.     end
  20. end
  21.    
  22. ngOnInit() {
  23.     this.Form = this.fb.group({
  24.         first_name: this.fb.control(null, Validators.required),
  25.         last_name: this.fb.control(null, Validators.required),
  26.         email: this.fb.control(null, Validators.required),
  27.         password: this.fb.control(null, Validators.required)
  28.     });
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top