I have a static array in my User model declared like this:
class User < ActiveRecord::Base
...
states = ['NYC', 'CAL', ...]
...
end
I know I should create a model for the states but I figured I just need the list for registration purposes. When I try to use it in a view like this:
= f.select(:state, options_for_select(states))
I get a Undefinded Method error. I tried using instance variables through the controller and that didnt work either. Whats the correct way of doing this?
STATES = ['NYC', 'CAL', ...]in corresponding controller, instead of model