rails console 裡面沒有全部顯示資料庫裡面的資料。
mysql> select * from pages;
+----+------------+--------------+-----------+----------+---------+---------------------+---------------------+
| id | subject_id | name | permalink | position | visible | created_at | updated_at |
+----+------------+--------------+-----------+----------+---------+---------------------+---------------------+
| 1 | 1 | First Page | 0 | 1 | 0 | 2016-04-16 11:10:52 | 2016-04-16 11:10:52 |
| 2 | NULL | Seconde Page | 0 | 2 | 0 | 2016-04-17 09:54:04 | 2016-04-17 09:54:04 |
| 3 | NULL | Third Page | 0 | 2 | 1 | 2016-04-17 06:32:04 | 2016-04-17 06:32:04 |
| 4 | NULL | Forth Page | 0 | 4 | 1 | 2016-04-17 06:33:18 | 2016-04-17 06:33:18 |
| 5 | NULL | Fifth Page | 0 | 5 | 1 | 2016-04-17 14:35:53 | 2016-04-17 14:35:53 |
| 6 | NULL | Sixth Page | 6 | 6 | 0 | 2016-04-18 14:33:22 | 2016-04-18 14:33:22 |
| 7 | NULL | Seventh Page | 7 | 7 | 0 | 2016-04-18 14:35:22 | 2016-04-18 14:35:22 |
| 8 | NULL | Seventh Page | 7 | 7 | 0 | 2016-04-18 14:41:50 | 2016-04-18 14:41:50 |
| 9 | NULL | Seventh Page | 7 | 7 | 0 | 2016-04-18 14:41:57 | 2016-04-18 14:41:57 |
| 10 | NULL | p10s | 7 | 7 | 0 | 2016-04-18 14:41:58 | 2016-04-18 07:01:24 |
| 11 | 23 | page1 | 1 | 0 | 0 | 2016-04-28 07:29:29 | 2016-04-28 07:29:29 |
| 12 | 23 | k | 0 | 0 | 0 | 2016-04-28 14:07:42 | 2016-04-28 14:07:42 |
| 13 | 23 | new page | 3 | 3 | 0 | 2016-04-28 14:46:31 | 2016-04-28 14:46:31 |
| 14 | NULL | page1 | 10 | 1 | 0 | 2016-04-28 14:50:51 | 2016-04-28 14:50:51 |
+----+------------+--------------+-----------+----------+---------+---------------------+---------------------+
14 rows in set (0.00 sec)
irb(main):001:0> Page.all
Page Load (0.5ms) SELECT pages
.* FROM pages
=> #
rails c 中 展示資料庫條數預設是10 。後面的省略號看到了沒。
如果想看有多少條的話 可以使用Page.count