Repository URL to install this package:
|
Version:
0.0.9 ▾
|
module Neoteric
module EventsController
def self.included(base)
base.before_filter :find_upcoming_events,
:find_archive_months
end
def index
@title = "Events"
@events = EVENT_CLASS.upcoming
end
def show
@event = EVENT_CLASS.find(params[:id])
end
def archive
@title = "Events in #{Date::MONTHNAMES[params[:month].to_i]} #{params[:year]}"
@events = EVENT_CLASS.by_month(params[:year], params[:month])
render :template => 'events/index'
end
private
def find_upcoming_events
@upcoming_events = EVENT_CLASS.upcoming.limit(5)
end
def find_archive_months
@event_archive_months = EVENT_CLASS.archive_months
end
end
end