Rails- nested content_tag

前端 未结 4 1852
执笔经年
执笔经年 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:14

    You can also use the concat method:

    module InputHelper
      def editable_input(label,name)
        content_tag :div, :class => "field" do
          concat(content_tag(:label,label))
          concat(text_field_tag(name,'', :class => 'medium new_value'))
        end
      end
    end
    

    Source: Nesting content_tag in Rails 3

提交回复
热议问题