1
0
Fork 0
forked from OpenNeo/impress
impress/app/controllers/contributions_controller.rb

13 lines
393 B
Ruby
Raw Normal View History

2010-11-06 08:52:58 -07:00
class ContributionsController < ApplicationController
def index
2010-11-06 08:57:22 -07:00
if params[:user_id]
@user = User.find params[:user_id]
@contributions = @user.contributions
else
@contributions = Contribution.includes(:user)
end
@contributions = @contributions.recent.paginate :page => params[:page]
2010-11-06 08:52:58 -07:00
Contribution.preload_contributeds_and_parents @contributions
end
end