I have a User model that belongs to a University and a Faculty and a Department.
A University has many Faculties. A Faculty has many Departments.
In my user creation form (using devise), What is the best way to have 3 drop down lists that change accordingly as I change one of them.
For example:
I want to limit the amount of ajax and javascript. I want to know if there is an elegant solution provided by rails itself.
There are two ways to do this. First one is through ajax and second one is through javascript only.
First options is very easy to implement as your sorting and filtering will be done in controller.
Second option is bit complex as you need to load all data in json form into javascript variable. They will be ruby hash which will be converted into json before storing in javascript variable before page load. Plus point of this way is that all data we be loaded in a single request.