I use best_in_place to edit inline and country_select entries to display a list of countries to select. When using best_in_place to edit the select field, I do this:
<%= best_in_place(@home, :country_name, :type => :select, :collection => [[1, "Spain"], [2, "Italy"]]) %>
Now I like to get a list of all countries that country_select has and passes this value to the collection parameter. The country_select driver provides a simple helper to display the select box:
<%= country_select("home", "country_name") %>
I would like to replace the: collection parameter in the best_in_place helper to include a list of countries provided by country_select. I know that best_in_place is waiting for input [[key, value], [key, value], ...] in: collection, but I'm not sure how to do this. Please advise. Thanks
source
share