Sha256: 8a933ddd72e7a166d9a6be238eef98badb585aa7283ab29f49f362d5433e3f07

Contents?: true

Size: 725 Bytes

Versions: 5

Compression:

Stored size: 725 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
      flash[:notice] = "User #{@user.email} created."
      redirect_to users_url
    else
      render 'new'
    end
  end  
  
  def edit
    @user = User.find(params[:id])
  end

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

  def destroy
    @user = User.find(params[:id])
    @user.destroy
    redirect_to users_url  
  end  

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
i0n_rails3_generators-0.2.19 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.18 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.17 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.16 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb
i0n_rails3_generators-0.2.15 lib/generators/i0n/authentication/templates/app/controllers/_users_controller.rb