I am trying to drop in enum values setup with the 'Enumerize' gem into the radio collection select field on a rails-bootstrap-form.
An example is shown how to do this with an ActiveRecord collection. How should I modify the example
<%= f.collection_radio_buttons :skill_level, Skill.all, :id, :name %>
So that it can accept an enum that is setup on my model
<%= f.collection_radio_buttons :level %>
skill.rb
class Skill < ActiveRecord::Base
extend Enumerize
enumerize :level, in: [:good, :ok, :bad ]
end
The Enumerize documentation says
SimpleForm
If you are using SimpleForm gem you don't need to specify input type (:select by default) and collection:
<%= simple_form_for @user do |f| %> <%= f.input :sex %> <% end %>
and if you want it as radio buttons:
<%= simple_form_for @user do |f| %> <%= f.input :sex, :as => :radio_buttons %> <% end %>