30 lines
807 B
Ruby
30 lines
807 B
Ruby
class AnnouncementsController < ApplicationController
|
|
|
|
def index
|
|
@announcements = Announcement.find(:all, :conditions => { :entry_name => params[:entry_name] })
|
|
|
|
respond_to do |format|
|
|
format.html {
|
|
@page = Page.find_by_name( 'announcement_index')
|
|
@page_options = { "announcements" => @announcements.map{ |a| a.to_liquid } }
|
|
render_liquid_page
|
|
}
|
|
format.xml { render :xml => @announcements }
|
|
end
|
|
end
|
|
|
|
def show
|
|
@announcement = Announcement.find(params[:id])
|
|
|
|
respond_to do |format|
|
|
format.html{
|
|
@page = Page.find_by_name( 'announcement_show')
|
|
@page_options = { 'announcement' => @announcement.to_liquid }
|
|
render_liquid_page
|
|
}
|
|
format.xml { render :xml => @announcement }
|
|
end
|
|
end
|
|
|
|
end
|