ecm_courses2 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5310f66fa592f26c326a8b5ac5d0b8bebb1fc050
4
- data.tar.gz: fbb46dbdd4ee0ae780d48324dc56eb16c9ac92d7
3
+ metadata.gz: 6ac9d692a0dbca8da096616acc55313f6700ea55
4
+ data.tar.gz: 534696d10a6bd8d17bd70b86978886d657252918
5
5
  SHA512:
6
- metadata.gz: efef4bb2e440a79b5c77348f563c507b9ee1ebc80cafaf3ab3330439a5b56d0155aae8a72a67822a4fe67bdddc801165aab3c32239b9be6c89599c9373756f4a
7
- data.tar.gz: 81093bd93b70339fdd7818fc6738d0b01b8e150815a387442f0bb5a63b87b116048c5710e5a83e9368dc090e8615ea025ed22bae083d24d2e242b0e8f18c68fc
6
+ metadata.gz: bffeba15c668991b20f93746ffe0ec691411881f9e3e34d30c4c1d1d771b79e34443e85d5579eed2c9cebcc2133801cbb565a16016a590a0b279373f8f822174
7
+ data.tar.gz: 2480820d04d8424237dc6d44c168420d27f791d5673955b4d2010b8451618b654e1ea2e8251fce1ea8bce8d23901544f014358b2f9c94e2ffad86ea17b447c43
@@ -17,11 +17,13 @@ module Ecm::Courses
17
17
  @course_category = load_resource
18
18
  @courses = @course_category.courses.all
19
19
  @course_dates = @courses.reduce([]) { |cd, c| cd << c.course_dates.for_month(@date).all }.flatten
20
- end
21
20
 
22
- def ical
23
- @resource = load_resource
24
- send_data @resource.to_icalendar.to_ical, type: 'text/calendar' # , disposition: 'inline'
21
+ respond_to do |format|
22
+ format.html
23
+ format.ics do
24
+ send_data @course_category.to_icalendar.to_ical, type: 'text/calendar'
25
+ end
26
+ end
25
27
  end
26
28
 
27
29
  private
@@ -9,9 +9,9 @@
9
9
  = month_calendar_pagination(date)
10
10
  = month_calendar date, course_dates, display_method: :course, start_day: :monday
11
11
  .bottom-margin-4
12
- = link_to(ical_course_category_path(course_category), class: 'btn btn-default') do
12
+ = link_to(url_for(format: :ics), class: 'btn btn-default') do
13
13
  %span.glyphicon.glyphicon-calendar
14
- = ical_course_category_url(course_category)
14
+ = url_for(format: :ics)
15
15
 
16
16
  .course_categories-tree
17
17
  = nested_li(course_category.descendants, {}) do |course_category, level|
data/config/routes.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  Ecm::Courses::Engine.routes.draw do
2
2
  localized do
3
- resources :course_categories, only: [:index, :show] do
4
- get :ical, on: :member
5
- end
3
+ resources :course_categories, only: [:index, :show]
6
4
  resources :courses, only: [:show] do
7
5
  member do
8
6
  get "calendar", action: :calendar
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Courses
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_courses2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-08 00:00:00.000000000 Z
11
+ date: 2017-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -388,7 +388,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
388
  version: '0'
389
389
  requirements: []
390
390
  rubyforge_project:
391
- rubygems_version: 2.5.1
391
+ rubygems_version: 2.6.10
392
392
  signing_key:
393
393
  specification_version: 4
394
394
  summary: Ecm::Courses.