Forum: Ruby on Rails Is there a way to add items from the bottom of a drop down l

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bruce B. (Guest)
on 2006-01-22 07:01
(Received via mailing list)
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
Bob S. (Guest)
on 2006-01-22 09:14
(Received via mailing list)
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.
Jonathan V. (Guest)
on 2006-01-22 13:23
Check out the widgets in scriptaculous, see
http://wiki.script.aculo.us/scriptaculous/show/Aut... 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
This topic is locked and can not be replied to.