class Barnardos::RubyDesignSystem::Inputs::TextInput
Overrides behaviour of the text input in simple_form forms.
Usage: Add the following class to the host project at app/inputs/text_input.rb
class StringInput < Barnardos::RubyDesignSystem::Inputs::TextInput; end
With that in place, the following code will output a textarea wrapped in the required Design System components:
<%= simple_form_for(foo) do |form| %> <%= form.input :bar %> <% end %>
Where `bar` is a text attribute of `foo`
Public Instance Methods
input(wrapper_options = nil)
click to toggle source
Calls superclass method
# File lib/barnardos/ruby_design_system/inputs/text_input.rb, line 23 def input(wrapper_options = nil) input_html_classes.unshift('TextArea-textarea') super end