Is there a way to add items from the bottom of a drop down l


#1

I am writing a banking / accounting / bookkeeping system for myself.
I have orgs (who pay me or who I pay) and line_items (day to day
transactions that mirror the entries on my bank statements)

On my line_items screen I have a select box with various orgs in it.
I’d like to have a way to add an org write there on that screen
rather than have to leave it and go back to the orgs screen, add it
there and return.

Is that possible from within a select box? If so, how?

Thanks in advance,

bruce


#2

Using the AJAX features in Rails, you can accomplish what you want. You
will
need a text_field to name the new org and a button to trigger the remote
function. Once you make the remote function, you have can rewrite the
container the select box is in with the new select box with the new org
included.

Read the Javascript Helper docs in Rails to piece it together.

Hope this gets you started. I’ve only been using rails for 3 days, so I
can’t write example code for you (yet).

Bob S.


#3

Check out the widgets in scriptaculous, see
http://wiki.script.aculo.us/scriptaculous/show/Autocompletion for demos.
The auto completing text box may be what you’re after, but not if you’re
using the select box to select an id.

The approach Bob suggested should work. You would just have a little
form on your page somewhere which created a new organisation and
rendered back the updated select box.

-Jonny.

bruce balmer wrote:

I am writing a banking / accounting / bookkeeping system for myself.
I have orgs (who pay me or who I pay) and line_items (day to day
transactions that mirror the entries on my bank statements)

On my line_items screen I have a select box with various orgs in it.
I’d like to have a way to add an org write there on that screen
rather than have to leave it and go back to the orgs screen, add it
there and return.

Is that possible from within a select box? If so, how?

Thanks in advance,

bruce