Sha256: ac738f1da691ff0fe0542fa6a6749c1e9cf50e5cb492381a75808e306afd60ac

Contents?: true

Size: 511 Bytes

Versions: 10

Compression:

Stored size: 511 Bytes

Contents

class EntriesController < ApplicationController
  helper_method :entry, :comment

  def index
    @entries = Entry.published.paginate(
      :page => (params[:page] || 1),
      :per_page => (SETTINGS.entries_per_page || 5)
    )
  end

  def show
    if entry.draft? && ! admin_signed_in?
      render 'public/404.html', :layout => false, :status => 404
    end
  end

  private

    def entry
      @entry ||= Entry.find(params[:id])
    end

    def comment
      @comment ||= entry.comments.new
    end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jabe-0.5.9 app/controllers/entries_controller.rb
jabe-0.5.8 app/controllers/entries_controller.rb
jabe-0.5.7 app/controllers/entries_controller.rb
jabe-0.5.6 app/controllers/entries_controller.rb
jabe-0.5.5 app/controllers/entries_controller.rb
jabe-0.5.4 app/controllers/entries_controller.rb
jabe-0.5.3 app/controllers/entries_controller.rb
jabe-0.5.2 app/controllers/entries_controller.rb
jabe-0.5.1 app/controllers/entries_controller.rb
jabe-0.5.0 app/controllers/entries_controller.rb