Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap_form error undefined method

1- I installed gem bootstrap_form
2- I wrote in application.css that line *= require bootstrap_form before the */
3- in my html.erb

<%= bootstrap_form_for(@guardian, :url => student_guardians_path(@student),
html: { class: 'form-horizontal' },
method: :post) do |f| %>

And I am getting the following error : undefined methodbootstrap_form_for' for #<#:0xb31a80c>`

like image 702
Mostafa Hussein Avatar asked Jun 27 '13 17:06

Mostafa Hussein


3 Answers

I was getting the same error. Fixed it by replacing

gem 'bootstrap-form'

by

gem 'bootstrap_form'

in my gemfile

like image 88
Zuhaib Ali Avatar answered Nov 15 '22 09:11

Zuhaib Ali


I recently had this issue and my problem was that bundle install seemed to be pulling v3.0.0, yet the most recent version on GitHub is listed as 2.3.0. Changing the appropriate line in my Gemfile to:

gem 'bootstrap_form', '~> 2.3.0'

Fixed the issue.

like image 24
teaearlgraycold Avatar answered Nov 15 '22 09:11

teaearlgraycold


I too was getting this error until I realized that I didn't restart the rails server. When I restarted the server, the error disappeared.

like image 23
Whyves Avatar answered Nov 15 '22 09:11

Whyves