Class UserGroupsController
In: app/controllers/user_groups_controller.rb
Parent: ApplicationController

Methods

destroy   find  

Public Instance methods

def create

  @user_group = UserGroup.new(params[:user_group])
  @user_group.memberships.build(:user => current_user, :admin_settings => true)
  if @user_group.save
    redirect_to user_group_ll_url(@user_group)
  end

end

[Source]

    # File app/controllers/user_groups_controller.rb, line 46
46:   def destroy
47:     # Only site admin and group-admin can destroy it
48:     if (current_user.admin? or @user_group.admin_permissions?(current_user)) and
49:         @user_group != UserGroup.public and @user_group != UserGroup.system
50:       if @user_group.destroy
51:         flash[:notice] = "The usergroup was successfully deleted"
52:         redirect_to root_url
53:       else
54:         flash[:warning] = "The usergroup could not be destroyed! Please retry"
55:         redirect_to user_group_ll_url(@user_group)
56:       end
57:     else
58:       flash[:error] = "You don't have permission to destroy this usergroup"
59:       redirect_to user_group_ll_url(@user_group)
60:     end
61:   end

Protected Instance methods

Filter-methods

[Source]

    # File app/controllers/user_groups_controller.rb, line 67
67:   def find
68:     @user_group = UserGroup.find(params[:id])
69:   end

[Validate]