开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜