开发者

Enumerate all fields of a model in Rails

Is there a way to enumerate each fiel开发者_开发知识库ds of a model with his information (column name, type...) ?

Article model : content string title string


You're looking for the ActiveRecord helper columns_hash():

Article.columns_hash
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜