rosa-build/app/controllers/activity_feeds_controller.rb

16 lines
564 B
Ruby
Raw Normal View History

class ActivityFeedsController < ApplicationController
before_filter :authenticate_user!
def index
2012-03-16 15:37:58 +00:00
@filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all
2012-03-15 17:52:54 +00:00
@activity_feeds = current_user.activity_feeds
@activity_feeds = @activity_feeds.where(:kind => "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all
@activity_feeds = @activity_feeds.paginate :page => params[:page]
2012-03-21 10:25:30 +00:00
if request.format == '*/*'
render '_list', :layout => false
else
render 'index'
end
end
end