Class: FeatureBox::UsersController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability, #pages_helper, #retrieve_vars

Methods included from Helpers

define_helpers, included

Instance Method Details

#destroyObject



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

#editObject



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

def edit
end

#indexObject



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

#updateObject



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