RoR | how to get content_tags to nest?

Posted by Digital Cake on Stack Overflow See other posts from Stack Overflow or by Digital Cake
Published on 2012-06-01T04:08:07Z Indexed on 2012/06/01 4:41 UTC
Read the original article Hit count: 407

As you can see I have a helper with a method that I'm trying to render out to the view.

The nested content_tags do not render what is my disconnect about this tag?

def draw_calendar(selected_month, month, current_date)
  content_tag(:table) do

    content_tag(:thead) do

      content_tag(:tr) do

        I18n.t(:"date.abbr_day_names").map{ |day| content_tag(:th, day, :escape => false) }

      end #content_tag :tr
    end #content_tag :thead 

    content_tag(:tbody) do 

      month.collect do |week| 

        content_tag(:tr, :class => "week") do

          week.collect do |date| 

            content_tag(:td, :class => "day") do

              content_tag(:div, date.day, :class => (Date.today == current_date ? "today" : nil))

            end #content_tag :td
          end #week.collect
        end #content_tag :tr
      end #month.collect
    end #content_tag :tbody 
  end #content_tag :table
end #draw_calendar

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby