【发布时间】:2013-06-27 17:35:15
【问题描述】:
1- 我安装了 gem bootstrap_form
2- 我在 application.css 中写了那行 *= require bootstrap_form before the */
3- 在我的 html.erb
<%= bootstrap_form_for(@guardian, :url => student_guardians_path(@student),
html: { class: 'form-horizontal' },
method: :post) do |f| %>
我收到以下错误:undefined methodbootstrap_form_for' for #`
【问题讨论】:
-
你在 Gemfile 中添加了 gem 吗?
-
是但不在特定组中,只是写在我的gem文件顶部
-
尝试 bootstrap_form_for([@student,@guardian]......并删除 url,你不需要它,因为你正在将表单与对象绑定。
标签: ruby-on-rails ruby-on-rails-3 forms