Skip to content

Instantly share code, notes, and snippets.

@linusthe3rd
Created May 18, 2011 18:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linusthe3rd/979123 to your computer and use it in GitHub Desktop.
Save linusthe3rd/979123 to your computer and use it in GitHub Desktop.
Rails - Create a select tag for grades K-12
<%= f.label :grade %>
<%= f.select(:grade, (["K"] | (1..12).to_a))%>
@linusthe3rd
Copy link
Author

The union operator ("|") combines the two arrays through a union on the two sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment