When using simple form on an Active Record with encrypted fields the encrypted fields are all mapped to textarea input ignoring their database type (text or string).
Expected behavior
Use input[type=text] if the database column is a string.
Patch locally to fix it
module SimpleFormEncryptedAttributesExtension
private
def find_attribute_column(attribute_name)
if @object.respond_to?(:encrypted_attributes) && @object.encrypted_attributes && @object.encrypted_attributes.include?(attribute_name)
return @object.column_for_attribute(attribute_name)
end
super
end
end
SimpleForm::FormBuilder.prepend(SimpleFormEncryptedAttributesExtension)
Environment
Current behavior
When using simple form on an Active Record with encrypted fields the encrypted fields are all mapped to textarea input ignoring their database type (text or string).
Expected behavior
Use input[type=text] if the database column is a string.
Patch locally to fix it