I am trying to include a default blank first option in a select field as follow:
= f.select :role, options_for_select(User::ROLE), {}, include_blank: true, class: "form-control"
which is not giving the expected outcome.
User::ROLE
is an array in the User class as follow:
ROLE = ["user", "doctor", "manager"]
How can I make the select option in the field to return a blank option for first select, without having to include a blank option as first element of my ROLE
array? Thanks
Below should fix it:
Here is the method signature:
select(object, method, choices = nil, options = {}, html_options = {}, &block) public