Bootstrap_form undefined boot method

1- I set gem bootstrap_form
2- I wrote in application.css that the 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 get the following error: undefined method bootstrap_form_for 'for # <#: 0xb31a80c> `

+8
source share
4 answers

This problem was solved by writing the form code correctly, as shown in @ sunny1304 comment bootstrap_form_for([@student,@guardian] . Therefore, if none of the existing answers worked for you, it could be a hint or something that you will help.

Thanks to other authors, as their answers helped other users who encountered a problem like me.

0
source

I was getting the same error. Fixed by replacing

 gem 'bootstrap-form' 

by

 gem 'bootstrap_form' 

in my gemfile

+6
source

I also got this error until I realized that I did not restart the rails server. When I restarted the server, the error disappeared.

+5
source

I recently had this problem and my problem was that installing the package seems to be pulling out v3.0.0, but the latest version of GitHub is listed as 2.3.0. Changing the corresponding line in my gemfile:

 gem 'bootstrap_form', '~> 2.3.0' 

The problem is fixed.

+1
source

All Articles