Module: CalendarHelper
- Defined in:
- lib/table_builder/calendar_helper.rb
Defined Under Namespace
Classes: Calendar, CalendarBuilder
Instance Method Summary collapse
Instance Method Details
#calendar_for(objects, *args) {|builder.new(objects || [], self, calendar, options)| ... } ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/table_builder/calendar_helper.rb', line 3 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 concat(tag(:table, , true)) yield builder.new(objects || [], self, calendar, ) concat('</table>') end |