I have found many codes and blog posts for dynamic drop down with mysql in rails. But I want to implement it with mongoid in my application. Many codes that I found are not perfectly working for this. Some gave me problem of non appearing data during edit. So I tried to develop my own dynamic drop-down with mongoid in rails. Finally I become success to implement full featured rails dynamic drop down with mongoid and coffeescript.
Find the source code in github:
First of all you make sure that mongodb is installed.
If you want to copy and customize the app with changes that are only useful for your own project, you can clone the GitHub repo. You probably should generate the app instead (see below). To clone:
$ git clone git://github.com/gkunwar/dynamic-dropdown.git
Then install the bundle and run the application.