Class: GroupsController

Inherits:
InheritedResources::Base
  • Object
show all
Defined in:
app/controllers/groups_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

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

#indexObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/groups_controller.rb', line 10

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

  index! do |format|
    format.html { render :layout => (user_signed_in? ? 'application' : 'frontpage') }
  end
end