Best way to add new items to a select?


#1

hey all,
I have a select tag like this:

<%= select ‘movie’,‘director_id’,Director.find(:all).collect {|x|
[x.name, x.id]} %>

I would like to add a new director in case it’s missing from the
select. I would like to do this the Ajax way maybe with a
in_place_select? or by putting an rjs link that replace the select
with a textfield and a button but I’m not sure maybe there’s a better
way.
I also like how they do it in google mail, where the last option of
the select is a “create a new label”, then if I click on that option
in the select it popups a dialog and then updates the select.

Any ideas or links to demo?

thanx in advance

Pat