Sha256: 036d108ac55e25a8e24c4138ac0e28504b7f33854bb22786364df89b813233f9

Contents?: true

Size: 571 Bytes

Versions: 10

Compression:

Stored size: 571 Bytes

Contents

module Jabe
  class EntriesController < ApplicationController
    include ApplicationHelper

    helper_method :entry, :comment

    def index
      @entries = Entry.published.
        page(params[:page]).
        per( Jabe::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
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jabe-0.9.1 app/controllers/jabe/entries_controller.rb
jabe-0.9.0 app/controllers/jabe/entries_controller.rb
jabe-0.8.0 app/controllers/jabe/entries_controller.rb
jabe-0.7.0 app/controllers/jabe/entries_controller.rb
jabe-0.6.5 app/controllers/jabe/entries_controller.rb
jabe-0.6.4 app/controllers/jabe/entries_controller.rb
jabe-0.6.3 app/controllers/jabe/entries_controller.rb
jabe-0.6.2 app/controllers/jabe/entries_controller.rb
jabe-0.6.1 app/controllers/jabe/entries_controller.rb
jabe-0.6.0 app/controllers/jabe/entries_controller.rb