Coder Social home page Coder Social logo

Comments (11)

wingrunr21 avatar wingrunr21 commented on July 4, 2024

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.

kenleezle avatar kenleezle commented on July 4, 2024

I can reproduce it without that optional hash. Will post backtrace right now without those options.

from bootstrap_form.

kenleezle avatar kenleezle commented on July 4, 2024
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.

kenleezle avatar kenleezle commented on July 4, 2024

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.

kenleezle avatar kenleezle commented on July 4, 2024

Here is the commit that removed that argument:

3e2f13d#diff-d858d9de5eda99f11a7840b6c015c89e

from bootstrap_form.

kenleezle avatar kenleezle commented on July 4, 2024

Referenced this issue in that commit.

from bootstrap_form.

kenleezle avatar kenleezle commented on July 4, 2024

My bad @wingrunr21, this seems to be unrelated to bootstrap_nested_form... even my bootstrap_form's are broken now.

from bootstrap_form.

wingrunr21 avatar wingrunr21 commented on July 4, 2024

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.

potenza avatar potenza commented on July 4, 2024

@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.

kenleezle avatar kenleezle commented on July 4, 2024

Got it, thanks guys.
Just to be clear, nested form support is only available for rails 4 then?

from bootstrap_form.

potenza avatar potenza commented on July 4, 2024

@kenleezle as of now, yes

from bootstrap_form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.