ragegage / robinbanks

Stock price visualizer built with Rails and React
https://www.robinbanks.herokuapp.com/
0 stars 0 forks source link

create users controller #2

Closed ragegage closed 8 years ago

ragegage commented 8 years ago

`def show @user = User.find(params[:id]) render :show end def create @user = User.new(user_params) if @user.save status = 200 render :show status: status else status = 500 @errors = @user.errors.full_messages render :show status: status end end def destroy @user = User.find(params[:id]) if @user.destroy status = 200 render :show status: status else status = 500 @errors = @user.errors.full_messages render :show status: status end end

private def user_params params.require(:user).permit(:username, :password) end`

ragegage commented 8 years ago

^untested

ragegage commented 8 years ago

closing; will reopen if testing fails