I need an array with the column names of a table
Any ideas how I can do this with rails 3.0.0rc?
For ActiveRecord:
Model.column_names
For Mongoid:
Model.attribute_names
Output:
=> ["id", "title", "body", "created_at", "updated_at"]
Note: It'll be _id instead of id for Mongoid
_id
id