Insert a non-input row into a Formtasic form

前端 未结 4 770
谎友^
谎友^ 2020-12-13 21:29

I am using Formtastic 2.1.1 in Rails 3.2 (with Active Admin) and I want to insert a row into my form that does not have an input field present. Is this poss

4条回答
  •  既然无缘
    2020-12-13 21:46

    Here's a slightly simplified form of @arsen7's answer:

    f.form_buffers.last << 
      "

    Activate interlock, dynatherms connected

    ".html_safe

    which in my form looks like this:

    Simple HTML insert

    And here's one that mimics ActiveAdmin's default style:

    f.form_buffers.last << (<
      
      
    Dynatherms connected
  • END ).html_safe

    which looks like this:

    ActiveAdmin-style HTML insert

提交回复
热议问题