Sha256: 4aa08150bcd00241e062d6637f770a7c995dee3ce840cff5597728a90cb7f43a
Contents?: true
Size: 648 Bytes
Versions: 7
Compression:
Stored size: 648 Bytes
Contents
class UsersController < ApplicationController before_filter :login_required, :except => [:new, :create] def new @user = User.new end def create @user = User.new(params[:user]) if @user.save session[:user_id] = @user.id redirect_to root_url, :notice => "Thank you for signing up! You are now logged in." else render :action => 'new' end end def edit @user = current_user end def update @user = current_user if @user.update_attributes(params[:user]) redirect_to root_url, :notice => "Your profile has been updated." else render :action => 'edit' end end end
Version data entries
7 entries across 7 versions & 2 rubygems