Files
growstuff/app/controllers/home_controller.rb
Skud e8cb5e89b6 Changed interesting methods to always return 12
... because it makes the caching more effective.  Use .first(n) to get a
smaller number if you want it.
2013-08-14 11:58:54 +10:00

23 lines
578 B
Ruby

class HomeController < ApplicationController
skip_authorize_resource
def index
# for the stats partial
@member_count = Member.confirmed.count
@crop_count = Crop.count
@planting_count = Planting.count
@garden_count = Garden.count
@crops = Crop.interesting.first(6)
@recent_crops = Crop.recent.limit(12)
@plantings = Planting.interesting.first(4)
@seeds = Seed.interesting.first(6)
@members = Member.interesting.first(6)
respond_to do |format|
format.html # index.html.haml
end
end
end