… and for the above select box i have an observe field that never
fires up; based on the selection of the first box the second select box
should be populated, and if “Create New” is selected a new record is to
be created.
<%= observe_field(“test_company”,
{:url => {:controller=> ‘/test’,:action =>
‘update_people’},
:update =>“test_person”,
:loading => “Element.show(‘indicator’)”,
:complete => “Element.hide(‘indicator’)”,
:with => "test_company}) %>
If i use
<%= select(:test, :company
,Company.find_all_by_name(test.company.to_s).map{|c| [c.external_id,
c.name]})%>
for my first select box then the observe field works … but i cannot
insert the “Create New” option.
What am I doing wrong?! Any help it would appreciated.
… and for the above select box i have an observe field that never
fires up; based on the selection of the first box the second select box
should be populated, and if “Create New” is selected a new record is to
be created.
<%= observe_field(“test_company”,
{:url => {:controller=> ‘/test’,:action =>
‘update_people’},
:update =>“test_person”,
:loading => “Element.show(‘indicator’)”,
:complete => “Element.hide(‘indicator’)”,
:with => "test_company}) %>
If i use
<%= select(:test, :company
,Company.find_all_by_name(test.company.to_s).map{|c| [c.external_id,
c.name]})%>
for my first select box then the observe field works … but i cannot
insert the “Create New” option.
What am I doing wrong?! Any help it would appreciated.
Thank you,
Sincerely,
Don’t know why the first one doesn’t work, but if you do: