Class: UserMembershipsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- UserMembershipsController
- Defined in:
- app/controllers/user_memberships_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/user_memberships_controller.rb', line 6 def create #This should pull from current_organization @organization = Organization.find(params[:organization_id]) :manage, @organization with_user do |user| build_membership(user, @organization) or build_errors(user, @organization) end redirect_to organization_url(@organization) and return end |
#destroy ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/controllers/user_memberships_controller.rb', line 18 def destroy @organization = Organization.find(params[:organization_id]) @mship = UserMembership.find(params[:id]) :manage, @organization @mship.destroy redirect_to organization_url(@organization), :notice => "User has been removed from #{@organization.name}" and return end |
#new ⇒ Object
2 3 4 |
# File 'app/controllers/user_memberships_controller.rb', line 2 def new @organization = Organization.find(params[:organization_id]) end |