Class: Junebug::Controllers::Userinfo

Inherits:
R
  • Object
show all
Defined in:
lib/junebug/controllers.rb

Instance Method Summary collapse

Instance Method Details

#get(username) ⇒ Object



158
159
160
161
162
163
164
165
166
167
# File 'lib/junebug/controllers.rb', line 158

def get username
  @page_title = "User info"
  @user = User.find_by_username(username)
  @versions = Page::Version.find(:all, :conditions => ["user_id = ?", @user.id], :order=>'updated_at desc')
  @groups = Hash.new {|hash,key| hash[key] = []}
  @versions.each { |p|
    @groups[p.updated_at.strftime('%Y-%m-%d')].push(p)
  }
  render :userinfo
end