Re: Help with custom FormBuilder

Yossef Mendelssohn
2007-03-25T14:47:55Z

Josh,

About knowing the ID of the form element, there are methods in Action
Pack for that.  I can''t recall them off the top of my head, and to be
honest, some of my immense form builder bypassed and provided its own
IDs, so I knew exactly what was going on.  But look for something like
"assign_default_name_and_id" and you''ll see what''s
going on.

As for your Array#merge problem, if I''m not mistaken it''s just
that
you''re calling super(label, args) instead of super(label, *args).  See
this:

def args_length(*args)
  args.length
end

def blah(arg1, *args)
  args_length(args)
end

blah(''test'')
=> 1
blah(''test'', 1, 2, 3, 4)
=> 1

def blah(arg1, *args)
  args_length(*args)
end

blah(''test'')
=> 0
blah(''test'', 1, 2, 3, 4)
=> 4


And there''s one thing that jumps out at me.  You''ve changed it
so
you''re calling super for your brand-new association methods
(has_and_belongs_to_many, belongs_to), but the parent class doesn''t
have them (I assume).
--
-yossef