Comments (11)
Yes it works fine in my test app. What are you passing bootstrap_nested_form_for
? Need to know what bsf_opts
is.
from bootstrap_form.
I can reproduce it without that optional hash. Will post backtrace right now without those options.
from bootstrap_form.
ActionView::Template::Error (wrong number of arguments (5 for 4)):
1: =bootstrap_nested_form_for(@ast_queue) do |f|
2: .section
3: .section_header General Options
4: = f.text_field :name, :disabled => !@ast_queue.new_record?, :help => "This will help you identify the queue especially if you have multiple queues. Do not use spaces in the name, in place of a space use a dash or underscore. Ex: Sales_Queue."
app/views/ast_queues/_form.html.haml:1:in `_app_views_ast_queues__form_html_haml__1923276433556906628_70181219076560'
app/views/ast_queues/edit.html.haml:2:in `_app_views_ast_queues_edit_html_haml__1901783170888274213_70181230962400'
-------------------------------
Backtrace:-------------------------------
/Users/k3leland/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-bootstrap-forms-ef1d6f7535a0/lib/bootstrap_form/form_builder.rb:18:
in `initialize' actionpack (3.2.17) lib/action_view/helpers/form_helper.rb:962:in `new'
actionpack (3.2.17) lib/action_view/helpers/form_helper.rb:962:in `instantiate_builder'
actionpack (3.2.17) lib/action_view/helpers/form_helper.rb:377:in `form_for'
haml (4.0.5) lib/haml/helpers/action_view_mods.rb:139:in `form_for_with_haml'
haml (4.0.5) lib/haml/helpers/action_view_xss_mods.rb:28:in `form_for_with_haml_xss'
/Users/k3leland/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-bootstrap-forms-ef1d6f7535a0/lib/bootstrap_form/helper.rb:23:in `bl
ock in bootstrap_form_for'
/Users/k3leland/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-bootstrap-forms-ef1d6f7535a0/lib/bootstrap_form/helper.rb:36:in `te
mporarily_disable_field_error_proc'
/Users/k3leland/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-bootstrap-forms-ef1d6f7535a0/lib/bootstrap_form/helper.rb:22:in `bo
otstrap_form_for'
/Users/k3leland/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-bootstrap-forms-ef1d6f7535a0/lib/bootstrap_form/helpers/nested_form.rb:15:in `bootstrap_nested_form_for'
app/views/ast_queues/_form.html.haml:1:in `_app_views_ast_queues__form_html_haml__1923276433556906628_70181219076560'
from bootstrap_form.
Here is a patch that seems to fix it:
bash-3.2$ git diff form_builder.rb
diff --git a/lib/bootstrap_form/form_builder.rb b/lib/bootstrap_form/form_builder.rb
index 3a4c707..8fdb08d 100644
--- a/lib/bootstrap_form/form_builder.rb
+++ b/lib/bootstrap_form/form_builder.rb
@@ -15,7 +15,7 @@ module BootstrapForm
delegate :content_tag, :capture, :concat, to: :@template
- def initialize(object_name, object, template, options)
+ def initialize(object_name, object, template, options, proc=nil)
@layout = options[:layout]
@label_col = options[:label_col] || default_label_col
@control_col = options[:control_col] || default_control_col
from bootstrap_form.
Here is the commit that removed that argument:
3e2f13d#diff-d858d9de5eda99f11a7840b6c015c89e
from bootstrap_form.
Referenced this issue in that commit.
from bootstrap_form.
My bad @wingrunr21, this seems to be unrelated to bootstrap_nested_form... even my bootstrap_form's are broken now.
from bootstrap_form.
I believe that Proc was removed for Rails 4.1 compatibility.
As this is unrelated to nested_form support I'm going to close this issue.
from bootstrap_form.
@kenleezle @wingrunr21 is correct... for rails 3 support, please see:
https://github.com/bootstrap-ruby/rails-bootstrap-forms/tree/v2.0.1
from bootstrap_form.
Got it, thanks guys.
Just to be clear, nested form support is only available for rails 4 then?
from bootstrap_form.
@kenleezle as of now, yes
from bootstrap_form.
Related Issues (20)
- Option to provide `is-invalid` class to labels along with fields HOT 1
- Range control has wrong class HOT 5
- Release version 5.2.0 HOT 8
- Need to include ActiveRecord::Reflection for custom form class with 5.2.0 HOT 1
- Rename the default layout to "vertical" ? HOT 2
- Can't disable number_field HOT 3
- DEPRECATION WARNING: Calling `<<` to an ActiveModel::Errors message array in order to add an error is deprecated HOT 3
- [Rails 7.1] Association Validator Keyed by Association Name
- Can't edit classes on input elements. HOT 5
- Release new version (5.3.0) HOT 2
- new version 5.3.0 - undefined method `arity' for HOT 4
- V 5.3.1 - Using ruby's %w() array shortcut in bootstrap_form_for statement causes 'ActionView::Template::Error:' HOT 6
- Generate System Test Baseline via GitHub Actions
- Some Examples May Be Failing
- `collection_check_boxes` does not work with Rails 6.1 HOT 3
- Lazy load ActionText helpers HOT 10
- Overriding form tag's 'control_col' not working for f.check_box (layout: :horizontal)
- Need to use plain method for visibility with bootstrap_form in Phlex Component HOT 2
- render problem HOT 3
- Update Gemfiles?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap_form.