title: Ajax Dynamic Menu Ruby on Rails
body: <p>I'm implementing a category and subcategory. However, it is using only 1 model with the gem 'awesome_nested_set', so when I click my first collection_Select, it will process my Ajax and return an instant variable for my controller and get the category for the second collection select. I'm almost done, but I still have a little problem.</p>
  
  <ol>
  <li><p>When I load the page, it gives me an error: "might expect an instance of array". I know why this happens, it's because when I load the page, it actually loads the js, but initially, I haven't clicked the first collection_select. I can't get the value from the select and my controller cannot get the params from there too.</p></li>
  <li><p>I did try to not run the partial, but my Firebug console shows me red color, but I see it can get the params from the first collection_select.</p></li>
  </ol>
  
  <p>Here is my <a href="https://gist.github.com/2995276" rel="nofollow">gist.gihub</a></p>
  
  <p>The full code is provided, please guide me, I need some modifications...</p>