Module: CalendarHelper
- Defined in:
- lib/table_builder/calendar_helper.rb
Defined Under Namespace
Classes: Calendar, CalendarBuilder
Instance Method Summary collapse
-
#calendar_for(objects, *args) ⇒ Object
Generates a calendar (as a table) for an array of objects placing each of them on the corresponding date.
Instance Method Details
#calendar_for(objects, *args) ⇒ Object
Generates a calendar (as a table) for an array of objects placing each of them on the corresponding date.
**TODO: fully document this method, the current documentation is far from done.**
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/table_builder/calendar_helper.rb', line 12 def calendar_for(objects, *args) raise ArgumentError, "Missing block" unless block_given? = args.last.is_a?(Hash) ? args.pop : {} = [:html] builder = [:builder] || CalendarBuilder calendar = [:calendar] || Calendar content_tag(:table, nil, ) do yield builder.new(objects || [], self, calendar, ) end end |