Sha256: 8b90e6cdd72e6f09c46040fd0c75111769def8514e20e8411dcc15ed2d6a6f43
Contents?: true
Size: 879 Bytes
Versions: 6
Compression:
Stored size: 879 Bytes
Contents
class AccountController < ApplicationController layout 'scaffold' include LoginSystem def login case @request.method when :post if @session[:user] = User.authenticate(@params[:user_login], @params[:user_password]) flash['notice'] = "Login successful" redirect_back_or_default :action => "welcome" else flash.now['notice'] = "Login unsuccessful" @login = @params[:user_login] end end end def signup if @request.post? @user = User.new(@params[:user]) if @user.save @session[:user] = User.authenticate(@user.login, @params[:user][:password]) flash['notice'] = "Signup successful" redirect_back_or_default :action => "welcome" end end end def logout @session[:user] = nil end def welcome end end
Version data entries
6 entries across 6 versions & 1 rubygems