First off, I recommend popping through the Ruby on Rails guide to ActiveRecord
To specifically answer your question, a couple of different options:
You can monitor the table contents through your model. (More preferable, probably)
Try opening up a rails console (rails console
, rails c
, or irb
), and typing in Number.all
, which will return a list of all Number records stored in the table. There are many other queries which can accomplished this way; check out the ActiveRecord::Base API doc for more info.
OR
You can perform database queries directly on the database table you created.
- For sqlite3: http://sourceforge.net/projects/sqlitebrowser/
- For postgresql: Install Postgresql and use PSQL to query your database directly using SQL.
EDIT: Since you want to perform this in another controller, use the first method, calling Number.all
to get a list of all Number records stored in your database. You can also call Number.first
, Number.last
or Number.find(<number_id>)
if you only want a single record to be returned.