newb q: Dynamic Dropdown Menu - Observe field - Ajax

Hi Guys,

I am trying to get my head around drop down menus and observe_field (ajax?)

I have : a 'job' model a vfxshotid model

A job has_many :vfxshotids A vfxshotid belongs_to :job

I need a page that has 2 drop down menus The first - list of 'vfxshotids' for a job The second - is a list of directories in a 'vfxshotid' directory.

At the moment I don't know how to pass the arguements around. I followed this post but i can get it to work, and i wonder if the code is out of date anyway - http://www.nabble.com/related-drop-down-list---ajax-td2367869.html

If anyone can give me some advice I'd really appreciate it.

Thanks!

Adam

Here is my code:

Hi Guys,

I am trying to get my head around drop down menus and observe_field (ajax?)

Yup observe_field uses ajaz

At the moment I don't know how to pass the arguements around. I followed this post but i can get it to work, and i wonder if the code is out of date anyway -http://www.nabble.com/related-drop-down-list---ajax-td2367869.html

Well something that will confuse the browser is the fact that you've got 2 things on the page with id vfxapp_id_container which can easily have unpredictable consequences. Your get_vfxapps_for_vfxshotid action should be using params[:vfxshotid] since that's what will get submitted by observe_field. Other than that you haven't said exactly what is happening/not working so it's hard to say anything more.

Fred

Fred thanks for replying - I will try to apply what you've suggested and post the results, cheers!

haha! success!

the controller's function seemed to be outputting with a layout - ???

i read that to disable a rendered layout u just need to append the following to a function:

render :layout => false

sweet!