Class: GroupsController

Inherits:
ApplicationController
  • Object
show all
Includes:
SocialStream::Controllers::Subjects
Defined in:
app/controllers/groups_controller.rb

Instance Method Summary collapse

Methods included from SocialStream::Controllers::Subjects

#profile_subject

Instance Method Details

#createObject



24
25
26
27
28
29
30
31
# File 'app/controllers/groups_controller.rb', line 24

def create
  create! do |success, failure|
    success.html {
      self.current_subject = @group
      redirect_to :home
    }
  end
end

#destroyObject



33
34
35
36
37
38
39
40
# File 'app/controllers/groups_controller.rb', line 33

def destroy
  destroy! do |success, failure|
    success.html {
      self.current_subject = current_user
      redirect_to :home
    }
  end
end

#indexObject



14
15
16
17
18
19
20
21
22
# File 'app/controllers/groups_controller.rb', line 14

def index
  @groups = Group.most(params[:most]).
                  alphabetic.
                  letter(params[:letter]).
                  name_search(params[:search]).
                  tagged_with(params[:tag]).
                  page(params[:page]).per(10)

end