Reputation: 1337
Is there a good way to set maxlength on input tags using the corresponding limits from the database schema? I can always check the database lengths for fields, and then hard code the maxlength values, but I would prefer not to have those settings in two places.
Upvotes: 0
Views: 95
Reputation: 1212
Refer to rails api docs TableDefinition#column :limit suits your needs
Upvotes: 1