Rails- nested content_tag

前端 未结 4 1850
执笔经年
执笔经年 2020-12-02 07:38

I\'m trying to nest content tags into a custom helper, to create something like this:

&l
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 08:23

    building nested content tags with iteration is a little different and gets me every time... here is one method:

          content_tag :div do
            friends.pluck(:firstname).map do |first| 
              concat( content_tag(:div, first, class: 'first') )
            end
          end
    

提交回复
热议问题