public
Description: El Dorado is a full-stack community web application written in Ruby/Rails.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/trevorturk/el-dorado.git
el-dorado / app / controllers / home_controller.rb
100644 16 lines (13 sloc) 0.888 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class HomeController < ApplicationController
  
  def index
      @date = Time.parse("#{params[:date]} || TzTime.now")
      @avatars = Avatar.find(:all, :limit => 3, :include => :user, :order => 'avatars.updated_at desc')
      @message = Message.last
      @chatters = User.chatting
      @events = Event.find(:all, :conditions => ['date between ? and ?', @date.strftime("%Y-%m") + '-01', @date.next_month.strftime("%Y-%m") + '-01'])
      @headers = Header.find(:all, :limit => 3, :include => :user, :order => 'headers.created_at desc')
      @topics = Topic.find(:all, :limit => 20, :include => [:user, :forum, :last_poster], :order => 'topics.sticky desc, topics.last_post_at desc')
      @uploads = Upload.find(:all, :limit => 5, :include => :user, :order => 'uploads.updated_at desc')
      @users = User.find(:all, :limit => 3, :order => 'profile_updated_at desc')
  end
  
end