Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/users_controller.rb', line 7 def create if params[:commit] === 'Sign up' $user = User.create(user_params) if $user.save session[:user_id] = $user.id redirect_to root_path, notice: 'Sign in successfull' else redirect_to :back, notice: 'Problems creeting a user' end else redirect_to :back end end |
#index ⇒ Object
3 4 5 |
# File 'app/controllers/users_controller.rb', line 3 def index end |
#user_params ⇒ Object
23 24 25 |
# File 'app/controllers/users_controller.rb', line 23 def user_params params.permit(:name, :email, :password, :password_confirmation) end |