Skip to content

Instantly share code, notes, and snippets.

@vessi
Created May 15, 2012 12:31
Show Gist options
  • Save vessi/2701400 to your computer and use it in GitHub Desktop.
Save vessi/2701400 to your computer and use it in GitHub Desktop.
usage of array for select
<select name="name" id="id">
<% %w(one two three).each_with_index do |option, index| %>
<option value="<%= index %>"><%= option %></option>
<% end %>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment