Class: UserGroupMembershipsController
Instance Method Summary
collapse
#current_navable, #current_navable=, #current_user, #point_navigation_to, #redirect_www_subdomain, #set_locale
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'app/controllers/user_group_memberships_controller.rb', line 16
def create
if membership_params[:user_title].present?
@user_id = User.find_by_title(membership_params[:user_title]).id
@user_group_membership = UserGroupMembership.create(membership_params.merge({user_id: @user_id}))
else
head :no_content
end
end
|
#destroy ⇒ Object
41
42
43
44
45
46
|
# File 'app/controllers/user_group_memberships_controller.rb', line 41
def destroy
if @user_group_membership
@user_group_membership.destroy
head :no_content
end
end
|
#index ⇒ Object
8
9
10
11
12
13
14
|
# File 'app/controllers/user_group_memberships_controller.rb', line 8
def index
authorize! :manage, @user
@user = User.find(params[:user_id])
@memberships = UserGroupMembership.now_and_in_the_past.find_all_by_user(@user)
@navable = @user
end
|
#show ⇒ Object
25
26
27
|
# File 'app/controllers/user_group_memberships_controller.rb', line 25
def show
end
|
#update ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/user_group_memberships_controller.rb', line 29
def update
if @user_group_membership.update_attributes!( membership_params )
respond_to do |format|
format.json do
respond_with @user_group_membership
end
end
end
end
|