Sha256: 3103d750c364780989c9d32179020950075f6599f84c2e8b4f353afe11148ad2

Contents?: true

Size: 705 Bytes

Versions: 3

Compression:

Stored size: 705 Bytes

Contents

class Ecm::Courses::CoursesController < ::FrontendController
  def calendar
    @year = params[:year] ||= Time.zone.now.year
    @month = params[:month] ||= Time.zone.now.month

    @date = Date.strptime("#{@month}-#{@year}", "%m-%Y")

    @course = Ecm::Courses::Course.includes(:ecm_courses_course_category, :ecm_courses_course_dates).find(params[:id])
    @course_dates = @course.ecm_courses_course_dates.for_month(@date).all
  end
  
  def index
    @courses = Ecm::Courses::Course.includes(:ecm_courses_course_category, :ecm_courses_course_dates).all
  end
  
  def show
    @course = Ecm::Courses::Course.includes(:ecm_courses_course_category, :ecm_courses_course_dates).find(params[:id])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ecm_courses-0.0.3.pre app/controllers/ecm/courses/courses_controller.rb
ecm_courses-0.0.2.pre app/controllers/ecm/courses/courses_controller.rb
ecm_courses-0.0.1.pre app/controllers/ecm/courses/courses_controller.rb