Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
neoteric-events / app / controllers / neoteric / events_controller.rb
Size: Mime:
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