HtmlSkeleton ============ HtmlSkeleton provides the frame for a calendar or a table, i.e. no loops are required to build up the HTML structure. Filling the skeleton is done via parameters and, in particular, with procs (Proc.new, lambda). See below Default Options. Install ------- gem 'html_skeleton' rake # for testing Calendar ======== A simple helper for creating an HTML calendar. The "calendar" method will be available to your view templates. Procs may be supplied to generate particular HTML-code for a day or the year. In the example below clicking a day triggers an action. Examples -------- HtmlSkeleton.new.calendar # calendar for current year HtmlSkeleton.new.calendar :year = 2012 # calendar for year 2012 HtmlSkeleton.new.calendar :year = 2012, :month => 8 # calendar for August 2012 HtmlSkeleton.new.calendar {|date| link ="/#{controller_name}/toggle/#{@resource.id}?date=#{date}" style = @resource.holidays.include?(date.to_s) ? 'font-weight:bold; color:red' : '' %Q{ #{date.day.to_s} } } Default Options --------------- :year => DateTime.now.year, :title => DateTime.now.year, :calendar_class => 'skeleton', :day_names => Date::DAYNAMES.dup, :month_names => Date::MONTHNAMES, :abbrev => (0..1), :cell_proc => block || lambda {|d| d.day.to_s}, :first_day_of_week => 1 Inspired by calendar_helper: * Jeremy Voorhis -- http://jvoorhis.com * Geoffrey Grosenbach -- http://nubyonrails.com Table ===== A simple helper for creating an HTML table. Table only takes care of the HTML tags and expects lambdas/strings to be supplied by the user. Examples -------- rows = %w{a bb ccc} cols = %w{1 22} HtmlSkeleton.new.table(rows, cols) {|row, col| col == '1' ? '