undefined方法`bootstrap_form_for'

时间:2015-09-21 21:18:51

标签: ruby-on-rails ruby twitter-bootstrap-3

我意识到之前已经在这里提出过这个问题,但我似乎没有与前一个人相同的问题,因为所提供的解决方案没有效果。

我的错误也有所不同。

undefined method `bootstrap_form_for' for #<#<Class:0x007fd2b0c2dbe0>:0x007fd2b0c2c948>

引用该方法的代码:

<%= bootstrap_form_for(@blob) do |f| %>
  <%= f.text_field :contentType %>
  <%= f.text_field :data %>
  <%= f.text_field :form_id %>

  <%= f.submit "Create BLOB" %>
<% end %>

该方法来自this gem

gem在Gemfile中,我已经重启了rails服务器几次,而且我已经尝试了多个模型。

1 个答案:

答案 0 :(得分:0)

似乎bundle install自动获取Gem的3.0.0版本,但GitHub列出了2.3.0作为最新版本。

在我的Gemfile中切换到2.3.0解决了这个问题。