Sha256: c982057409f83530edd99afa376c48bbba9d6c1ba2900b5c4b63ede1c070a058

Contents?: true

Size: 544 Bytes

Versions: 17

Compression:

Stored size: 544 Bytes

Contents

class NewsItemsController < ApplicationController

  before_filter :get_latest_posts
  before_filter :load_page, :only => [:index, :show]

  def index
    respond_to do |wants|
      wants.html
    end
  end

  def show
    @news_item = NewsItem.find(params[:id], :conditions => ["publish_date < ?", Time.now])

    respond_to do |wants|
     wants.html
    end
  end

protected

  def get_latest_posts
    @news_items = NewsItem.latest
  end

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

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
refinerycms-0.9.5.30 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.29 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.28 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.27 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.26 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.25 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.24 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.23 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.22 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.21 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.20 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.19 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.18 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.17 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.16 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.15 vendor/plugins/news/app/controllers/news_items_controller.rb
refinerycms-0.9.5.14 vendor/plugins/news/app/controllers/news_items_controller.rb