I would like to view the data in my DB while developing with Rails (actually in all 3 of them development, test and production). I have not touched the configs, so it should
Open terminal and type this command. This will open a rails console to query the database.
rails c
To get list of all the models you can use the following command
ActiveRecord::Base.connection.tables
example: ["schema_migrations", "ar_internal_metadata", "categories", "items"]
From the list of models, you can get first, last or all records.
Category.all