Class: ActivitiesController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/activities_controller.rb', line 2

def index
  # should be activities.page(params[:page], :count => { :select => 'activity.id', :distinct => true }) but it is not working in Rails 3.0.3 
  @activities =
    Activity.timeline(current_section,
                      current_subject).
             page(params[:page])

  respond_to do |format|
    format.html { render @activities }
    format.atom
  end
end

#showObject



15
16
17
18
19
# File 'app/controllers/activities_controller.rb', line 15

def show
  activity = Activity.find(params[:id])

  redirect_to activity.direct_object || activity.receiver_subject
end