9

Rails_Admin wiki解释了如何与 bootstrap-wysihtml5 集成,这非常容易。

但是,我希望 wysihtml5 小部件具有“编辑为 html”按钮。

这可能吗?

4

2 回答 2

6

您可以按每个字段配置 wysihtml5,如下所示。要启用 HTML 编辑器功能,请使用

RailsAdmin.config do |config|
  config.model Team do
    edit do
      field :description, :text do
        bootstrap_wysihtml5 true
        bootstrap_wysihtml5_config_options :html => true
      end
    end
  end
end

这是不久前添加到 Rails_admin,但他们不知何故忘记更新 Wiki。

于 2013-05-05T19:09:03.143 回答
4

上面的答案现在与当前版本的 Rails Admin 已经过时了。您应该使用以下语法来自定义编辑器:

field :description, :wysihtml5 do
  config_options :html => true
end

我已经更新了维基

于 2014-03-12T16:35:47.677 回答