I am using NetBeans to create my first Ruby on Rails application. Is there a way by which I can view all of the properties of a model? Should I just be looking in the database?
+2
A:
You could call Model.attributes
in Rails' console. This gives a hash with all attributes.
Be careful when using this inside your real code as it always recreates the hash and is therefore pretty expensive.
Koraktor
2009-09-18 17:31:57
+2
A:
You can use the annotate gem for this - it will add comments to the top of each model indicating its properties.
Greg Campbell
2009-09-18 17:32:39
A:
A nice little tool that I use is from MySQL. It is called MySQL Administrator.
It lets me validate that the db (development/test/production), the tables for the db, and finally the columns(attributes).
Gutzofter
2009-09-19 00:20:33