Class: Socializer::MembershipsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Socializer::MembershipsController
- Defined in:
- app/controllers/socializer/memberships_controller.rb
Instance Method Summary collapse
- #approve ⇒ Object
- #confirm ⇒ Object
- #create ⇒ Object
- #decline ⇒ Object
- #destroy ⇒ Object
- #invite ⇒ Object
Instance Method Details
#approve ⇒ Object
18 19 20 21 |
# File 'app/controllers/socializer/memberships_controller.rb', line 18 def approve @membership.approve! redirect_to @membership.group end |
#confirm ⇒ Object
30 31 32 33 |
# File 'app/controllers/socializer/memberships_controller.rb', line 30 def confirm @membership.confirm! redirect_to @membership.group end |
#create ⇒ Object
5 6 7 8 9 |
# File 'app/controllers/socializer/memberships_controller.rb', line 5 def create @group = Group.find(params[:membership][:group_id]) @group.join(current_user) redirect_to @group end |
#decline ⇒ Object
35 36 37 38 |
# File 'app/controllers/socializer/memberships_controller.rb', line 35 def decline @membership.decline! redirect_to groups_pending_invites_path end |
#destroy ⇒ Object
11 12 13 14 15 16 |
# File 'app/controllers/socializer/memberships_controller.rb', line 11 def destroy @membership = current_user.memberships.find(params[:id]) @group = @membership.group @group.leave(current_user) redirect_to @group end |