Insert a non-input row into a Formtasic form

前端 未结 4 768
谎友^
谎友^ 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:58

    IDK if this is still something people search for but it was for me. Since form_buffers has been deprecated, I did the following and it worked out beautifully (with some CSS help).

    form do |f|
    
      f.inputs "Model Info" do
        f.input :title
        f.input :published
        f.input :path
        li "Your important text here", class: "some_class"
      end
    end
    

    this outputs:

  • Your important text here
  • Got this idea from the docs after a too long Google search here FORMS and here ARBRE.

提交回复
热议问题