Class: FeatureBox::UsersController
Instance Method Summary
collapse
#current_ability, #pages_helper, #retrieve_vars
Methods included from Helpers
define_helpers, included
Instance Method Details
#destroy ⇒ Object
25
26
27
28
|
# File 'app/controllers/feature_box/users_controller.rb', line 25
def destroy
@user.destroy
redirect_to users_path, notice: 'User was successfully deleted.'
end
|
#edit ⇒ Object
12
13
|
# File 'app/controllers/feature_box/users_controller.rb', line 12
def edit
end
|
#index ⇒ Object
4
5
6
7
8
9
10
|
# File 'app/controllers/feature_box/users_controller.rb', line 4
def index
pages_helper do |limit,offset|
@users = User.limit(limit).offset(offset)
@total = User.count
@offset = offset
end
end
|
#update ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/feature_box/users_controller.rb', line 15
def update
@user.name = params[:user][:name]
@user.email = params[:user][:email]
if @user.save
redirect_to users_path, notice: 'User info was successfully updated.'
else
render action: "edit"
end
end
|