如何在activeadmin表单中显示自定义html

时间:2015-05-28 09:04:47

标签: ruby-on-rails activeadmin

如何以activeadmin形式显示自定义html

我想在表单中显示带有一些动态值的 h1

我怎么能得到它?

预期

exsisting_categories = ""
ActsAsTaggableOn::Tag.all.each do |t|
  exsisting_categories += "#{t.name}, "
end
=============> %h1 = exsisting_categories
f.inputs "Exsiting Categories" do
  text_area_tag :exsisting_categories, exsisting_categories, :input_html => { :disabled => true } 
end

1 个答案:

答案 0 :(得分:0)

你可以做到

exsisting_categories = ""
ActsAsTaggableOn::Tag.all.each do |t|
  exsisting_categories += "#{t.name}, "
end

h1 exsisting_categories