I have a Rails web application with a select box:
<%= select_tag :foo %>
I'm looking to write a function in the controller which would populate this select box with some values. What code would I need to write in order to do that?
The function is being invoked using observe_field:
<%= observe_field :foo, :url => { :action => :populate } %>
It's fine if the values are hard coded into the function.
def populate
# what goes here?
end
Thanks!