Skip to content

Instantly share code, notes, and snippets.

@ch1ago
Created October 1, 2015 00:59
Show Gist options
  • Save ch1ago/0aa9e723333b9c0801e6 to your computer and use it in GitHub Desktop.
Save ch1ago/0aa9e723333b9c0801e6 to your computer and use it in GitHub Desktop.
class Model
validates_inclusion_of :grade, in: :valid_grades
def valid_grades
[1,2,3,4,5]
end
end
## view
<%= f.select_tag, :grade, @model.valid_grades %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment