Q:

How to efficiently validate selects in Rails 4

I currently have a few select drop downs in my application. But I have no way of validating the input on the backend. You could essentially change the values and submit it and it would work. 
Take this for example:
  <%= f.select :gender, [['Male','male'],['Female','female']], required: "true" %>

how can I validate that what they submit is either 'male' or 'female' in the model? 

A:

Use validates_inclusion_of
In your model,write like this
 validates_inclusion_of :gender, :in => %w(Male Female male female)

