I want to build a select
input from an array (and not a collection of models), with SimpleForm, and have different classes for each option
s.
You also can pass array of arrays as an argument
= f.input :status, collection: [['option text', 'option_value_1', {"class" => "class_name_1"}], ['option text 2', 'option_value_2', {"class" => "class_name_2"}]]
This appears to be a limitation when using collections, see the author of SimpleForm's explanation here. He recommends a workaround of the form:
f.input :method, :as => :select do
f.select :method, [['option text', 'option_value_1', {"class" => "class_name_1"}], ['option text 2', 'option_value_2', {"class" => "class_name_2"}]]
end