Setting maxlength using database schema settings
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 setti开发者_如何学编程ngs in two places.
Refer to rails api docs TableDefinition#column :limit suits your needs
精彩评论