Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- UsersController
- Defined in:
- lib/generators/squeezer/templates/app/controllers/users_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
4 5 6 |
# File 'lib/generators/squeezer/templates/app/controllers/users_controller.rb', line 4 def index @users = User.all end |
#roles ⇒ Object
8 9 |
# File 'lib/generators/squeezer/templates/app/controllers/users_controller.rb', line 8 def roles end |
#update ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/squeezer/templates/app/controllers/users_controller.rb', line 11 def update if !params[:user] roles = [] else roles = params[:user][:role_ids] end flash[:notice]=params[:id] @user.update_attributes({:role_ids =>roles}) redirect_to roles_path end |