Sha256: 176cd1d5c2a87e38085a2b5956c8adc5051412a8e6832a358327ddc715efafa0

Contents?: true

Size: 708 Bytes

Versions: 5

Compression:

Stored size: 708 Bytes

Contents

  
  before_filter :login_required
  
  def index
    @users = User.all
  end
  
  
  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])
    if @user.save
      session[:user_id] = @user.id
      flash[:notice] = "Thank you for signing up! You are now logged in."
      redirect_to "/"
    else
      render :action => 'new'
    end
  end  
  
  def edit
    @user = current_user
  end

  def update
    @user = current_user
    respond_to do |format|
      if @user.update_attributes(params[:user])
        format.html { redirect_to(root_path, :notice => 'User information updated.') }
      else
        format.html { render :action => "edit" }
      end
    end
  end
  

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
i0n_rails3_generators-0.2.14 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.13 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.12 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.11 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.10 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb