views

Anna ha scritto:

Hi everybody! I'm new at ruby on rails, I'm trying to create a view like this:

*%= semantic_form_for :routes_status_race, :url => status_race_admin_routes_path do |f| %>* *<p>* *<% contact_array = Contact.all.map {|contact| [contact.name, contact.id]}%>* *<% route_importer_array = RouteImporter.all.map {|importer| [importer.name, importer.id]}%>* * *<b>Contact: <select size="contact_array.lenght"><%=options_for_select(contact_array)%></b>* *<b>Route Importer: <select size= "route_importer_array.lenght"><%=options_for_select(route_importer_array)%></b>* * *<p>* *<b>Import(csv): <%= f.file_field :uploaded_data, :size => "20" %></b>* *<b> **<%= submit_tag('Import', { :class => "Button" }) %></b>* *</p>*

*<% end %>*

The problem is that is just showing the first options_for_select, I mean right now I can see in the browser just Contact, but if I change the order and write Route Importer before I just can see Route Importer. The Import(csv) and the button are working right. Any idea that why I just can see the first select option and not both? Thanks in advance!

Check the resulting html code, I think you're missing </select> in both select