Last active
June 28, 2021 11:53
-
-
Save nataliaconde/46b2556c79b2563e1828cd411711bd3c to your computer and use it in GitHub Desktop.
Ruby controller/handler
This file contains 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
# sessions_controller.rb | |
class SessionsController < ApplicationController | |
def create | |
@login_form = LoginForm.new(params) | |
if @user = @login_form.submit | |
sign_in @user | |
redirect_to @user, notice: "Welcome!" | |
else | |
render action: :new | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment