Class: Eboshi::UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/eboshi/users_controller.rb

Instance Method Summary collapse

Methods included from ShallowRouteHelper

#assignment_path, #assignments_path, #convert_work_path, #edit_adjustment_path, #edit_invoice_path, #edit_work_path, #invoice_path, #invoices_path, #line_item_path, #merge_works_path, #new_adjustment_path, #new_assignment_path, #new_invoice_path, #new_payment_path, #payments_path, #work_path

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/eboshi/users_controller.rb', line 16

def create
  @user = User.new params[:user]
  if @user.save
    flash[:notice] = "Account registered!"
    redirect_to @user
  else
    render :new
  end
end

#editObject



26
27
28
# File 'app/controllers/eboshi/users_controller.rb', line 26

def edit
  @user = User.find params[:id]
end

#indexObject



3
4
5
6
# File 'app/controllers/eboshi/users_controller.rb', line 3

def index
  require_admin
  @users = User.all
end

#newObject



12
13
14
# File 'app/controllers/eboshi/users_controller.rb', line 12

def new
  @user = User.new
end

#showObject



8
9
10
# File 'app/controllers/eboshi/users_controller.rb', line 8

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

#updateObject



30
31
32
33
34
35
36
37
38
# File 'app/controllers/eboshi/users_controller.rb', line 30

def update
  @user = User.find params[:id]
  if @user.update params[:user]
    flash[:notice] = "Account updated!"
    redirect_to_last_client_or_back_or_default
  else
    render :edit
  end
end