开发者

Setting maxlength using database schema settings

开发者 https://www.devze.com 2023-04-13 01:47 出处:网络
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,

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

0

精彩评论

暂无评论...
验证码 换一张
取 消