Last active
September 14, 2016 21:23
-
-
Save eduardopoleo/62db59dcd1899b324933a31e4503049c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UsersController < ApplicationController | |
| def create | |
| @user = User.new(user_params) | |
| if @user.save | |
| flash[:success] = "Welcome to Monchitos. Hope you enjoy it!" | |
| redirect_to posts_path | |
| else | |
| flash[:error] = "Sorry your registration could not be completed" | |
| render :new | |
| end | |
| end | |
| private | |
| def user_params | |
| params.require(:user).permit(:email, :name, :user_name) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment