I am trying to load a simple select drop down menu from a collection. This is my code:
select("campus", "name", Campus.all.collect {|r| [ r.name, r.lat + "," + r.lng ] }, {:prompt => 'Select Campus'}, {:onchange => 'campus_change(this)'})
in my localhost (using SQLlite) it works fine, but in my production server (MYSQL) it is not loading the options.
I have checked the database and the table has the information I need to load, so that is not the problem.
Edit:
It seems that there are 2 databases. The results I am displaying for one table are not the same that are displayed in rails console. I don’t know how two switch between them.
Any help is greatly appreciated.
The seeds were populating the wrong database.
To populate the production db I had to run:
That fixed the problem