app/controllers/curupira/sessions_controller.rb in curupira-0.1.3 vs app/controllers/curupira/sessions_controller.rb in curupira-0.1.4
- old
+ new
@@ -1,16 +1,16 @@
-class Curupira::SessionsController < ApplicationController
+class Curupira::SessionsController < ActionController::Base
before_filter :redirect_to_root_with_errors, if: :current_user, except: :destroy
def new
@user = User.new
end
def create
@user = login(params[:user][:username], params[:user][:password])
if @user
- redirect_back_or_to(root_path, notice: 'Bem vindo!')
+ redirect_to(root_path, notice: 'Bem vindo!')
else
@user = User.new username: params[:user][:username]
flash[:alert] = "Login ou senha inválidos"
render :new
end