One entry (http://www.height1percent.com/articles/2006/04/18/
ajaxscaffold-3-1-0-released) talks about modifying the _form.rhtml
file and suggests code such as:
<code>
...
<div class="form-element">
<label for="pet_person">Owner%lt;/label>
<%= select 'pet', 'owner_id' , Person.find_all.collect {|p|
[ p.name, p.id ] } &>
</div>
...
</code>
but all I see in my existing _form.rhtml file is:
%lt;/code&rt;
%lt;fieldset&rt;
%lt;div class="row"&rt;
%lt;%= all_input_tags(scaffold_class, scaffold_name, { :exclude =>
%w(created_on created_at updated_on updated_at) }) %&rt;
%lt;/div&rt;
%lt;/fieldset&rt;
</code>
Does the "form-element" go before the closing fieldset? Or somewhere
else? I've not found this used elsewhere, so I don't have any other
models to study... it can't seem to match what I see in my files with
what people are talking about.
Any help would be much apprciated.
thanks...jon
I'm guessing that the example code above is for the generator, not for
the plugin... is this right?
Thanks...jon
1. Remove the "all_input_tags" line completely, and
2. Add "form-element" entries for EACH field that I want on the
form... i.e., recreate the form one field at a time
However, I still have a problem in that when the form goes to save the
new/updated record, I get a "field too long" error on the new drop-
down field. Right now, I'm guessing that the form is trying to return
not just the one result but a bunch of other stuff, but I can't tell
right now.
Back to digging...
### This creates the dropdown/select box from the type table...
# Note the doubled t.type_name, required to give the value and the
# display the correct values. There's only text in the type field.
<div class="form-element">
<label for="asset_entry_type">Entry Type</label>
<%= select 'asset', 'entry_type', Type.find_all.collect { |
t| [ t.type_name, t.type_name ] } %>
</div>
...jon