This is the view municipalities.js.erb I have:

<% list_opt = options_from_collection_for_select(@municipalities, :id,
:name) %>
<% puts list_opt  %> #ok! list_opt contains the options
$('#municipality_id').html('<%= list_opt %>');

and this is the combobox in the view:
...
Comune <select id="event_municipality_id"
name="event[municipality_id]"></select>
...

if instead of '<%= list_opt %>' I manually assign the string

'<option value="316">Alagna</option>
<option value="317">Albano</option>
<option value="318">AliceCastello</option>
<option value="319">Arborio</option>
...'
into list_opt then the combo municipality_id correctly works,
if I use options_from_collection_for_select doesn't works (empy
combobox)
but that string is the same of options_from_collection_for_select

then why doesn't work ? :(

Thank you,
Alessandro
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to