设想长篇案文的现行最佳做法是什么,例如将长篇文章分成多页?
我可以考虑的两种选择:
- store the string in a longtext column, slice it to an array and paginate over that. However, I m worried about memory usage and doing too much processing on the page load.
- slice up the text and store it in a page model (Article has_many :pages). Should work fine, but we d lose the flexibility of changing the page length.
什么是最佳办法? 是否有人失踪?