活动管理员显示HTML代码

时间:2013-01-21 17:34:40

标签: ruby-on-rails ruby activeadmin

我正在使用ejholmes Active_admin编辑器,它工作正常,但在我的活动管理员索引中,我看到带有标签的html代码,而不是正确的输出。我在我的观看中使用了.html_safe,但这里是我的主动管理员的posts.rb

...
index.do
    column :id
    column "Titolo", :title
    column "Corpo news", :body
    column "Creato il", :created_at
    column "Modificato il", :updated_at
    column :link
    column "Link Immagine", :image_url
    bool_column :attivo
    default_actions 
end
...

我想要呈现我的“Corpo新闻”专栏。 谢谢你的帮助!

1 个答案:

答案 0 :(得分:0)

我想你需要使用source所见的方法.to_html 所以在视图中你需要调用

  

body.to_html