observe_field for dynamic tables

Hi all,

I need to create a very simple dynamic table. I am trying to use
observe_field for dynamically update select box (so when I click a menu,
there will be generated a submenu according to what I have clicked).
Attached are my codes (getsubcategories,index, and controller). I
followed this tutorial :
http://railsforum.com/viewtopic.php?pid=31045#p31045, created a
database, but the table won't update it states in the second table based
on the database.

I am sorry if this is vague, but I hope from the attachments are easier
to pin point what I meant and to help me pointing out my mistake.

Thank you for your kindness response