Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby controller/handler
# 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