Class: Decidim::Attributes::CleanString
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- Decidim::Attributes::CleanString
- Defined in:
- lib/decidim/attributes/clean_string.rb
Overview
Custom attributes value to “standardize” the newline characters within strings that are sent through user entered forms. This strips out the carriage return characters from the strings in order to avoid validation mismatches with the string lengths between the frontend and the backend.
This type should be used with forms that have:
-
A user input defined with the <textarea> element
-
The input element having the ‘maxlength` attribute defined for it
-
The backend having a maximum length validation for the input
Instance Method Summary collapse
-
#type ⇒ Object
:nodoc:.
Instance Method Details
#type ⇒ Object
:nodoc:
15 16 17 |
# File 'lib/decidim/attributes/clean_string.rb', line 15 def type # :nodoc: :"decidim/attributes/clean_string" end |