Hello Again Rails Folk!
I’m trying to creat a page similar to what the person is doing here…
http://mudabone.com/aietc/?page_id=410
Instead of doing it the way he/she has, I decided to use RJS files, or
at least I tried.
Here’s my view
<%= start_form_tag %>
<%= javascript_include_tag “prototype” %>
Union:
Contract:
Rate Group
<%= observe_field(“contract”,
:frequency => 0.25,
:update => “rate_group”,
:url => { :action => :add_rate_group },
:with => “‘contract_id=’+value”) %>
<%= end_form_tag %>
and the two RJS files contiain somethign like this… for testing
purposes…
page.insert_html :bottom, ‘contracts’, ‘Test’
now, this works for the first change. If I make a change in Union, the
Contract is updated no problem… however, when I make a change to the
Contract DropDown, I’ not getting any changes to the third box ( Rate
Group ).
You would think there would be an OnChange event, rather than using
Observe_field. It seems that the second Observe_field doesn’t “see” the
contract element to watch it for changes.
I hope somone has a idea of what I’m trtying to do, and maybe some info
on what I’m doing wrong, or how I could do it better.
I can proabbly get it working the way the person in the linked article
did it, but I seem so close, I’m wondering what I’m doing wrong.
Cheers and thanks in advance,
Randal