Sunday, January 3, 2016

List Columns in table (in Rails Console)

From rails console, how to list columns in a particular table:
http://stackoverflow.com/questions/5575970/activerecord-list-columns-in-table-from-console

Model.column_names
e.g. User.column_names

No comments:

Post a Comment

Followers

Blog Archive