Sha256: b134512a5b12d72aa11fcb97bc33fae28106e7b6b7f12ebdfdb70f94a4bb5a05

Contents?: true

Size: 800 Bytes

Versions: 6

Compression:

Stored size: 800 Bytes

Contents

class Admin::UsersController < Admin::BaseController

  def index
    list
    render_action 'list'
  end

  def list
    @users = User.find_all
  end

  def show
    @user = User.find(params[:id])
  end

  def new
    @user = User.new(params[:user])
    if request.post? and @user.save
      flash[:notice] = 'User was successfully created.'
      redirect_to :action => 'list'
    end
  end

  def edit
    @user = User.find(params[:id])
    @user.attributes = params[:user]
    if request.post? and @user.save
      flash[:notice] = 'User was successfully updated.'
      redirect_to :action => 'show', :id => @user.id
    end
  end

  def destroy
    @user = User.find(params[:id])
    if request.post?
      @user.destroy if User.count > 1
      redirect_to :action => 'list'
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typo-3.99.0 app/controllers/admin/users_controller.rb
typo-3.99.2 app/controllers/admin/users_controller.rb
typo-3.99.3 app/controllers/admin/users_controller.rb
typo-3.99.1 app/controllers/admin/users_controller.rb
typo-4.0.0 app/controllers/admin/users_controller.rb
typo-3.99.4 app/controllers/admin/users_controller.rb