You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
ldlamarc
changed the title
Encrypted attributes always default to input[textarea]
Encrypted attributes always default to textarea
Jan 27, 2024
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
The text was updated successfully, but these errors were encountered: