Sha256: b18f455d85b67ed5cefd18d7674cb632cfac113635b7019440c6fdd1f2f24815
Contents?: true
Size: 429 Bytes
Versions: 13
Compression:
Stored size: 429 Bytes
Contents
class BlogsController < InheritedResources::Base respond_to :html, :xml belongs_to :user, :optional=>true before_filter :load_current_user def collection @blogs ||= end_of_association_chain. paginate(:page => params[:page], :order => 'created_at DESC' ) end def load_current_user unless params[:user_id] @user ||= (current_user ? User.find(current_user.id) : User.super_user) end end end
Version data entries
13 entries across 13 versions & 1 rubygems