John Topley’s Weblog

Rails Tip #4: Listing Model Column Names

You can use the built-in Rails console script to ask any model class for its column names:

Model.column_names

Comments

There aren’t any comments on this post. Comments are closed.


Archives

  • Jan
  • Feb
  • Mar
  • Apr
  • May
  • Jun
  • Jul
  • Aug
  • Sep
  • Oct
  • Nov
  • Dec

More Archives


Sign In