OK... Pilot error; I figured out how to get the "form-element" to
### 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>
> OK... I figured out some of it by digging through the AS code. What
> started working for me was to:
> 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...
> On Apr 6, 2:36 pm, "JSeidel" <jsei...@edpci.com> wrote:
> > Well... I tried out the example code and all it does it put the "form-
> > element" stuff at the bottom of the edit box as if it were trying to
> > set up the field.
> > I'm guessing that the example code above is for the generator, not for
> > the plugin... is this right?
> > Thanks...jon
> > On Apr 6, 11:17 am, "JSeidel" <jsei...@edpci.com> wrote:
> > > I want to make one of my fields (I'm using the plugin) a drop-down
> > > list. I've reviewed the posts here, as well as the blog entries on
> > > heightonepercent.com and caronsoftware.com and I have to admit that
> > > I'm completely confused.
> > > 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