Displaying 1 result from an estimated 1 matches for "date_l".
Did you mean:
date_r
2006 Jun 09
0
Controller Modules Messed Me Up
...t the public area to show the list of news. Here
is what I did:
/app/controllers/news_controller.rb
class NewsController < ApplicationController
def Index
@news = News.news_items
end
end
/app/models/news.rb
class News < ActiveRecord::Base
validates_presence_of :date_added, :date_live, :news_date, :added_by,
:headline, :summary, :article
def self.news_items
find( :all,
:conditions => "news_date <= now()",
:order => "news_date desc")
end
end
/app/views/news/index.rhtml
<h1>Recent News</h1>...