Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Getting a drop-down to work in the create/edit form
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
JSeidel  
View profile  
 More options Apr 6 2007, 2:17 pm
From: "JSeidel" <jsei...@edpci.com>
Date: Fri, 06 Apr 2007 11:17:39 -0700
Local: Fri, Apr 6 2007 2:17 pm
Subject: Getting a drop-down to work in the create/edit form
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>
...

&lt;div class="form-element"&gt;
  &lt;label for="pet_person"&gt;Owner%lt;/label&gt;
  &lt;%= select 'pet', 'owner_id' , Person.find_all.collect {|p|
[ p.name, p.id ] } &&gt;
&lt;/div&gt;

...
</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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JSeidel  
View profile  
 More options Apr 6 2007, 5:36 pm
From: "JSeidel" <jsei...@edpci.com>
Date: Fri, 06 Apr 2007 14:36:31 -0700
Local: Fri, Apr 6 2007 5:36 pm
Subject: Re: Getting a drop-down to work in the create/edit form
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JSeidel  
View profile  
 More options Apr 7 2007, 9:39 am
From: "JSeidel" <jsei...@edpci.com>
Date: Sat, 07 Apr 2007 06:39:26 -0700
Local: Sat, Apr 7 2007 9:39 am
Subject: Re: Getting a drop-down to work in the create/edit form
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JSeidel  
View profile  
 More options Apr 7 2007, 1:19 pm
From: "JSeidel" <jsei...@edpci.com>
Date: Sat, 07 Apr 2007 10:19:28 -0700
Local: Sat, Apr 7 2007 1:19 pm
Subject: Re: Getting a drop-down to work in the create/edit form
OK... Pilot error; I figured out how to get the "form-element" to
work:

### 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.
    &lt;div class="form-element">
        &lt;label for="asset_entry_type">Entry Type&lt;/label>
        &lt;%= select 'asset', 'entry_type', Type.find_all.collect { |
t| [ t.type_name, t.type_name ] } %>
        &lt;/div>

...jon

On Apr 7, 6:39 am, "JSeidel" <jsei...@edpci.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »