Sha256: 921be25b1605dcaf7da9970e817effb99f78f64ad27b20b4f7d50030a875fb01

Contents?: true

Size: 573 Bytes

Versions: 20

Compression:

Stored size: 573 Bytes

Contents

module RocketCMS
  module Controllers
    module News
      extend ActiveSupport::Concern

      def index
        @news = model.enabled.after_now.by_date

        unless RocketCMS.configuration.news_per_page.nil?
          @news = @news.page(params[:page])
        end
      end

      def show
        @news = model.after_now.find(params[:id])
      end
      
      private
      def model
        ::News
      end
      def page_title
        if @news.class.name == 'News'
          @news.page_title
        else
          super
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rocket_cms-0.5.14 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.12 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.11 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.10 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.9 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.8 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.7 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.6 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.5 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.4 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.3 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.2 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.1 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.0.rc.5 lib/rocket_cms/controllers/news.rb
rocket_cms-0.5.0.rc.4 lib/rocket_cms/controllers/news.rb
rocket_cms-0.4.2 lib/rocket_cms/controllers/news.rb
rocket_cms-0.3.2 lib/rocket_cms/controllers/news.rb
rocket_cms-0.2.12 lib/rocket_cms/controllers/news.rb
rocket_cms-0.2.10 lib/rocket_cms/controllers/news.rb