Mike,
I''ve done something very similar.
The only trick is that I believe there is not an AJAX helper for form
fields that creates an XMLHttpRequest.
You have 2 quick-and-dirty options then:
1. Use observe_field to create the ajax code, then dump it inside the
"onclick" attribute of the element in question.
2. Use observe_field to monitor if an element''s value changes.
I usually go with #1.
- Derek
On 5/31/05, Mike Gilbert <mike-jLbnyU+aYbUAvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> looking to see if I''m on the right track here...
>
> we''re selling widgets to customers, but there are a number of
different
> type of widgets and each different type of widget has a number of
> parameters that the customer can specify, in effect each customer orders
> widget''s customised in ways particular to that specific order.
>
> We use STI to store each different widget type order line in the database
> (some parameters are common to a number of widgets, while some are
> specific to just one type). Currently when ''creating''
their widget
> there is
> a lot of javascripting going on hiding fields and disabling fields
depending
> on the options selected as all fields are present on the form.
>
> To clean up the current entry screen where all options for all types of
> widgets are visible I was thinking of using Partials and AJAX. When
> the customer selects the widget type from a dropdown we load the
> partial for that type of widget.
>
> Does this sound like a reasonably Rails way of doing this ?
>
> Thanks
>
> --
> Mike Gilbert email :
mike-jLbnyU+aYbUAvxtiuMwx3w@public.gmane.org
> Technical Director fax : +353 68 470 01
> XL CRS mobile: +353 87 677 2055
> Lisselton phone : +353 68 470 10
> Listowel
> Co. Kerry
> Ireland
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Derek Haynes
blog - http://itsderek23.blogspot.com
Cell - 404.593.4879