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
精彩评论