This should work:
@physicians = User.where(userType: 'Physician')
You're getting error because options_from_collection_for_select
expects object that behaves like Array
, for example ActiveRecord::Relation
instance. But find_by_*
dynamic finder returns object representing singular record, User
instance in this case.
BTW, column names in Rails are by convention named with underscore instead of camel case , like user_type
.