Fearless Fool wrote in post #960459:
> Frederick Cheung wrote in post #960432:
>> Another [approach] would be to have the form created server side (ie 
>> normally),
>> but fill in the form values client side once they become known (and if
>> you care you can have the form hidden initially and show it only once
>> the geocoding data is available)
>>
>> Fred
>
> When I first read this, I slapped my head and said "doh! -- it's
> javascript, so of course it can modify the form generated by the
> server".
>
> But then I realized that it won't exactly work in my case.  I
> oversimplified the original problem statement: the javascript can
> generate an arbitrary number of these forms, and I don't know how many
> that will be beforehand.

In that case, you may want to use the Ajax approach.  Instead of having 
the JS generate the form itself, have it request a rendered partial from 
the server.  That way you can still use ERb (or better yet, Haml) rather 
than building the form in JavaScript, but the rendered forms don't all 
have to go into the DOM in advance.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to