Sha256: 25c6479ad5071efc3d05d6e1367b65e0416455d4e02f761d07e398930f73fe91

Contents?: true

Size: 428 Bytes

Versions: 8

Compression:

Stored size: 428 Bytes

Contents

class NewsItemsController < ApplicationController

  before_filter :find_latest_news_items, :find_page
  before_filter :find_news_item, :only => [:show]

protected

  def find_latest_news_items
    @news_items = NewsItem.latest # 10 items
  end

  def find_news_item
    @news_item = NewsItem.published.find(params[:id])
  end

  def find_page
    @page = Page.find_by_link_url("/news", :include => [:parts, :slugs])
  end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
refinerycms-news-0.9.7 app/controllers/news_items_controller.rb
refinerycms-news-0.9.6.1 app/controllers/news_items_controller.rb
refinerycms-news-0.9.6 app/controllers/news_items_controller.rb
refinerycms-0.9.6.19 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.6.18 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.6.17 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.6.16 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.6.15 vendor/plugins/news/app/controllers/news_items_controller.rb