module

Motion::HTML::InputHelpers

Constants

EMPTY_BOOLEAN_ATTRIBUTES = [] of Symbol

Instance methods

checkbox(field : Avram::PermittedAttribute(T), unchecked_value : String, checked_value : String, **html_options) : Nil forall T
Source
checkbox(field : Avram::PermittedAttribute(Bool | Nil), attrs : Array(Symbol), **html_options) : Nil
Source
checkbox(field : Avram::PermittedAttribute(Bool | Nil), **html_options) : Nil
Source
checkbox(field : Avram::Attribute, **options)
Source
color_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to color_input; this allows for Boolean attributes through attrs.

color_input(attribute, attrs: [:required])
# => <input type="color" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
color_input(field : Avram::Attribute, **options)
color_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a color input field.

color_input(attribute)
# => <input type="color" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
date_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil
Source
date_input(field : Avram::Attribute, **options)
Source
date_input(field : Avram::PermittedAttribute, **html_options) : Nil
Source
datetime_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil
Source
datetime_input(field : Avram::Attribute, **options)
Source
datetime_input(field : Avram::PermittedAttribute, **html_options) : Nil
Source
email_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to email_input; this allows for Boolean attributes through attrs.

email_input(attribute, attrs: [:required])
# => <input type="email" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
email_input(field : Avram::Attribute, **options)
email_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a email input field.

email_input(attribute)
# => <input type="email" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
file_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to file_input; this allows for Boolean attributes through attrs.

file_input(attribute, attrs: [:required])
# => <input type="file" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
file_input(field : Avram::Attribute, **options)
file_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a file input field.

file_input(attribute)
# => <input type="file" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
hidden_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to hidden_input; this allows for Boolean attributes through attrs.

hidden_input(attribute, attrs: [:required])
# => <input type="hidden" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
hidden_input(field : Avram::Attribute, **options)
hidden_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a hidden input field.

hidden_input(attribute)
# => <input type="hidden" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
number_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to number_input; this allows for Boolean attributes through attrs.

number_input(attribute, attrs: [:required])
# => <input type="number" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
number_input(field : Avram::Attribute, **options)
number_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a number input field.

number_input(attribute)
# => <input type="number" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
password_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil
Source
password_input(field : Avram::Attribute, **options)
Source
password_input(field : Avram::PermittedAttribute, **html_options) : Nil
Source
radio(field : Avram::PermittedAttribute(String | Nil), checked_value : String, attrs : Array(Symbol), **html_options) : Nil

Similar to radio; this allows for Boolean attributes through attrs.

radio(attribute, "checked_value", attrs: [:required])
# => <input type="radio" id="param_key_attribute_name_checked_value" name="param_key:attribute_name" value="checked_value" checked="true" required />
Source
radio(field : Avram::PermittedAttribute(String | Nil), checked_value : String, **html_options) : Nil

Returns a radio input field.

radio(attribute, "checked_value")
# => <input type="radio" id="param_key_attribute_name_checked_value" name="param_key:attribute_name" value="checked_value" checked="true">
Source
radio(field : Avram::Attribute, **options)
Source
range_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to range_input; this allows for Boolean attributes through attrs.

range_input(attribute, attrs: [:required])
# => <input type="range" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
range_input(field : Avram::Attribute, **options)
range_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a range input field.

range_input(attribute)
# => <input type="range" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
search_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to search_input; this allows for Boolean attributes through attrs.

search_input(attribute, attrs: [:required])
# => <input type="search" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
search_input(field : Avram::Attribute, **options)
search_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a search input field.

search_input(attribute)
# => <input type="search" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
submit(text : String, **html_options) : Nil
Source
telephone_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil
Source
telephone_input(field : Avram::Attribute, **options)
Source
telephone_input(field : Avram::PermittedAttribute, **html_options) : Nil
Source
text_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to text_input; this allows for Boolean attributes through attrs.

text_input(attribute, attrs: [:required])
# => <input type="text" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
text_input(field : Avram::Attribute, **options)
text_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a text input field.

text_input(attribute)
# => <input type="text" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source
textarea(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to textarea; this allows for Boolean attributes through attrs.

textarea(attribute, attrs: [:required])
# => <textarea id="param_key_attribute_name" name="param_key:attribute_name" required></textarea>
Source
textarea(field : Avram::Attribute, **options)
Source
textarea(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a textarea field.

textarea(attribute)
# => <textarea id="param_key_attribute_name" name="param_key:attribute_name"></textarea>
Source
time_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil
Source
time_input(field : Avram::Attribute, **options)
Source
time_input(field : Avram::PermittedAttribute, **html_options) : Nil
Source
url_input(field : Avram::PermittedAttribute, attrs : Array(Symbol), **html_options) : Nil

Similar to url_input; this allows for Boolean attributes through attrs.

url_input(attribute, attrs: [:required])
# => <input type="url" id="param_key_attribute_name" name="param_key:attribute_name" value="" required />
Source
url_input(field : Avram::Attribute, **options)
url_input(field : Avram::PermittedAttribute, **html_options) : Nil

Returns a url input field.

url_input(attribute)
# => <input type="url" id="param_key_attribute_name" name="param_key:attribute_name" value="" />
Source

Macros

error_message_for_unallowed_field
Source
generate_helpful_error_for(input_method_name)
Source