Class: Locomotive::MembershipsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::MembershipsController
- Defined in:
- app/controllers/locomotive/memberships_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/controllers/locomotive/memberships_controller.rb', line 14 def create Membership if @membership = service.create(membership_params[:email]) respond_with @membership, location: edit_current_site_path(current_site), flash: true else redirect_to new_account_path(email: membership_params[:email]) end end |
#destroy ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/locomotive/memberships_controller.rb', line 33 def destroy @membership @membership.destroy respond_with @membership, location: edit_current_site_path end |
#edit ⇒ Object
23 24 25 |
# File 'app/controllers/locomotive/memberships_controller.rb', line 23 def edit respond_with @membership end |
#new ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/locomotive/memberships_controller.rb', line 8 def new Membership @membership = current_site.memberships.build respond_with @membership end |
#update ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/locomotive/memberships_controller.rb', line 27 def update @membership self.service.change_role(@membership, membership_params[:role]) respond_with @membership, location: edit_current_site_path end |