RailsAdmin中的未定义方法`bootstrap_wysihtml5'

时间:2013-09-09 19:46:10

标签: ruby-on-rails ruby-on-rails-3 rails-admin

我正在尝试整合Bootstrap wysihtml5! railsadmin中的编辑器。我知道this guide,我跟着他一样。我在下面添加了我的代码。

config.model Region do

list do
  field :name
  field :description
  field :seos
  field :active
  field :publish
end

create do
  field :name
  field :description do
    bootstrap_wysihtml5 true
  end
  field :seos
end

update do
  field :name
  field :description do
    bootstrap_wysihtml5 true
  end
  field :seos
end
end

我收到错误

undefined method `bootstrap_wysihtml5' for # <RailsAdmin::Config::Fields::Types::Text:0x007fd3f27e6198> (NoMethodError)

我还尝试了在wiki中提到的另一种方法

config.model Region do
    list do
      field :name
      field :description
      field :seos
      field :active
      field :publish
    end

    create do
      field :name
      field :description , :wysihtml5
      field :seos
    end

    update do
      field :name
      field :description , :wysihtml5
      field :seos
    end
end

我再次收到以下错误。

Unsupported field datatype: wysihtml5 (RuntimeError)

Offcourse我添加了

gem 'bootstrap-wysihtml5-rails'

在gemfile中并完成捆绑安装。任何帮助都会节省很多时间。

1 个答案:

答案 0 :(得分:0)

我使用的是Rails管理员和Jquery Rails的版本。一旦更新它,它就能完美运行。

gem 'rails_admin', "~>0.4.3"
gem "jquery-rails", "~> 2.1"