Class: MembershipsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/memberships_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



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 ()
  end
end

#editObject



10
11
12
13
14
# File 'app/controllers/memberships_controller.rb', line 10

def edit
  find_membership
  @projects = .projects_by_name
  render
end

#indexObject



5
6
7
8
# File 'app/controllers/memberships_controller.rb', line 5

def index
  @memberships = .memberships_by_name
  render
end

#updateObject



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 ()
end