Sha256: 543b8e10c9a43acaa1671f2143fd3009c6f7c1c9809279736b883ce07991fd84

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 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.paginate(:page => params[:page]) # 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")
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
refinerycms-news-0.9.9 app/controllers/news_items_controller.rb
refinerycms-news-0.9.8.4 app/controllers/news_items_controller.rb
refinerycms-news-0.9.8.3 app/controllers/news_items_controller.rb
refinerycms-news-0.9.8.2 app/controllers/news_items_controller.rb
refinerycms-news-0.9.8.1 app/controllers/news_items_controller.rb
refinerycms-news-0.9.8 app/controllers/news_items_controller.rb