1, Pagination 分頁
參考http://api.rubyonrails.com/ paginate(collection_id, options={})
Returns a paginator and a collection of Active Record model instances for the paginator‘s current page. This is designed to be used in a single action。
注意它有兩個返回值
2,Layout
在app/views/下有個layout文件夾。如果使用scaffold生成的項目,layout下可以看到一個rhtml文件,內容類似如下:
這相當於所有其他rhtml的模板。假設你有另外一個view文件 show.rhtml,你在其中不必填寫header等羅索的東西,只要寫和你的業務相關的UI,執行的時候會套用這個模板。
3,partial
可能會看到這樣的代碼 render :partial => 'form'
這意味這在當前的UI頁面中會包含 _form.rhtml 的內容。