This is the list file for the view "news":

Listing news_posts

<% for column in NewsPost.content_columns %> <% end %> <% for news_post in @news_posts %> <% for column in NewsPost.content_columns %> <% end %> <% end %>
<%= column.human_name %>
<%=h news_post.send(column.name) %><%= link_to 'Show', :action => 'show', :id => news_post %> <%= link_to 'Edit', :action => 'edit', :id => news_post %> <%= link_to 'Destroy', { :action => 'destroy', :id => news_post }, :confirm => 'Are you sure?' %>
<%= link_to 'Previous page', { :page => @news_post_pages.current.previous } if @news_post_pages.current.previous %> <%= link_to 'Next page', { :page => @news_post_pages.current.next } if @news_post_pages.current.next %>
<%= link_to 'New news_post', :action => 'new' %> <% for show in @pooponastick %> pooponastick!
<% end %> This is the application.rb controller: # Filters added to this controller will be run for all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base @upcoming_shows = Show.find_upcoming_shows end This is the show model: class Show < ActiveRecord::Base belongs_to :venue def self.find_upcoming_shows find( :all, :conditions => "date >= now()", :order => "date asc") end end