Class: Eboshi::UsersController
Instance Method Summary
collapse
#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
#create ⇒ Object
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
|
#edit ⇒ Object
26
27
28
|
# File 'app/controllers/eboshi/users_controller.rb', line 26
def edit
@user = User.find params[:id]
end
|
#index ⇒ Object
3
4
5
6
|
# File 'app/controllers/eboshi/users_controller.rb', line 3
def index
require_admin
@users = User.all
end
|
#new ⇒ Object
12
13
14
|
# File 'app/controllers/eboshi/users_controller.rb', line 12
def new
@user = User.new
end
|
#show ⇒ Object
8
9
10
|
# File 'app/controllers/eboshi/users_controller.rb', line 8
def show
@user = User.find params[:id]
end
|
#update ⇒ Object
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
|