-
-
Save julianalucena/a9385565332c9d8e1e2c99fc31090aee 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