Class: MembershipsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MembershipsController
- Defined in:
- app/controllers/memberships_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/memberships_controller.rb', line 22 def destroy find_membership.destroy flash[:success] = "User removed." if @membership.user == current_user redirect_to edit_profile_url else redirect_to account_memberships_url(current_account) end end |
#edit ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/memberships_controller.rb', line 10 def edit find_membership @projects = current_account.projects_by_name render end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/memberships_controller.rb', line 5 def index @memberships = current_account.memberships_by_name render end |
#update ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/memberships_controller.rb', line 16 def update find_membership.update_attributes!(params[:membership]) flash[:success] = "Permissions updated." redirect_to account_memberships_url(current_account) end |