mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 10:45:04 -04:00
... because it makes the caching more effective. Use .first(n) to get a smaller number if you want it.
23 lines
578 B
Ruby
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
|