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.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