Sha256: 93cc04fdf13c66feaa667dff289d4ef1f54784bd5a33cdfecd6d24873cc19e05

Contents?: true

Size: 570 Bytes

Versions: 109

Compression:

Stored size: 570 Bytes

Contents

module RocketCMS
  module Controllers
    module News
      extend ActiveSupport::Concern

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

        unless RocketCMS.config.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 == model.name
          @news.page_title
        else
          super
        end
      end
    end
  end
end

Version data entries

109 entries across 109 versions & 1 rubygems

Version Path
rocket_cms-0.37.1 lib/rocket_cms/controllers/news.rb
rocket_cms-0.37.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.36.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.35.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.34.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.33.1 lib/rocket_cms/controllers/news.rb
rocket_cms-0.33.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.32.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.31.1 lib/rocket_cms/controllers/news.rb
rocket_cms-0.31.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.30.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.29.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.28.0 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.8 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.7 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.6 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.5 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.4 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.3 lib/rocket_cms/controllers/news.rb
rocket_cms-0.27.2 lib/rocket_cms/controllers/news.rb