implemented activities tab
[shapado:piglops-shapado.git] / app / controllers / activities_controller.rb
1 class ActivitiesController < ApplicationController
2   def index
3     conds = {}
4     if params[:context] == "by_me" && logged_in?
5       conds[:user_id] = current_user.id
6     end
7
8     @activities = current_group.activities.where(conds).order(:created_at.desc).
9                   paginate(:page => params[:page], :per_page => params[:per_page]||25)
10
11     respond_to do |format|
12       format.html
13       format.json { render :json => @activities }
14     end
15   end
16
17 end