class Barnardos::RubyDesignSystem::Inputs::CollectionSelectInput

Overrides behaviour of the collection select input in simple_form forms.

Usage: Add the following class to the host project at app/inputs/collection_select_input.rb

class CollectionSelectInput < Barnardos::RubyDesignSystem::Inputs::CollectionSelectInput; end

With that in place, the following code will output an HTML select input with class `Select` and wrapped in the required Design System components:

<%= simple_form_for(foo) do |form| %>
  <%= form.association :bars, wrapper: :design_system_select %>
<% end %>

Where `foo` has_many `bars`

Public Instance Methods

input(wrapper_options = nil) click to toggle source
Calls superclass method
# File lib/barnardos/ruby_design_system/inputs/collection_select_input.rb, line 23
def input(wrapper_options = nil)
  input_html_classes.unshift('Select')
  super
end