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

Version Path
wheels-0.0.17 app/controllers/blogs_controller.rb
wheels-0.0.16 app/controllers/blogs_controller.rb
wheels-0.0.15 app/controllers/blogs_controller.rb
wheels-0.0.14 app/controllers/blogs_controller.rb
wheels-0.0.13 app/controllers/blogs_controller.rb
wheels-0.0.11 app/controllers/blogs_controller.rb
wheels-0.0.10 app/controllers/blogs_controller.rb
wheels-0.0.9 app/controllers/blogs_controller.rb
wheels-0.0.8 app/controllers/blogs_controller.rb
wheels-0.0.6 app/controllers/blogs_controller.rb
wheels-0.0.5 app/controllers/blogs_controller.rb
wheels-0.0.4 app/controllers/blogs_controller.rb
wheels-0.0.3 app/controllers/blogs_controller.rb