Class: Barnardos::RubyDesignSystem::Inputs::TextInput
- Inherits:
-
SimpleForm::Inputs::TextInput
- Object
- SimpleForm::Inputs::TextInput
- Barnardos::RubyDesignSystem::Inputs::TextInput
- Defined in:
- lib/barnardos/ruby_design_system/inputs/text_input.rb
Overview
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
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#input(wrapper_options = nil) ⇒ Object
23 24 25 26 |
# File 'lib/barnardos/ruby_design_system/inputs/text_input.rb', line 23 def input( = nil) input_html_classes.unshift('TextArea-textarea') super end |