Repository URL to install this package:
|
Version:
0.5.1 ▾
|
module Neoteric
module EventsController
def self.included(base)
base.send(:include, ::Neoteric::ArchiverController)
base.archiving NeotericEvents.event_class
base.before_filter :find_upcoming_events
end
def index
@title = "Events"
@events = NeotericEvents.event_class.upcoming
end
def show
@event = NeotericEvents.event_class.find(params[:id])
end
def by_category
@category = NeotericEvents.event_category_class.find(params[:category_id])
@events = @category.events
render :template => 'events/index'
end
private
def find_upcoming_events
@upcoming_events = self.class.klass.upcoming.limit(5)
end
end
end