【发布时间】:2014-12-15 09:46:45
【问题描述】:
我已在我的字典 rails 应用程序 (https://github.com/lingz/alphabetical_paginate) 上部署了 alphabetical_paginate gem。除了当我单击一个字母时它会卡在加载轮上并且在我刷新页面之前不会分页这一事实之外,gem 的工作原理。
我只能假设这是 gem 内部的 javascript 问题,而不是我实现它的方式?
控制器:
class WordsController < ApplicationController
def index
@words, @alphaParams = Word.all.alpha_paginate(params[:letter], {:default_field => "all"}){|word| word.word}
end
查看:
<%= alphabetical_paginate @alphaParams %>
<table>
<thead>
<tr>
<th>Word</th>
<th>Wordtype</th>
<th>Description</th>
<th colspan="3"></th>
</tr>
</thead>
<div id="pagination_table">
<tbody>
<% @words.each do |word| %>
<tr>
<td><%= word.word %></td>
<td><%= word.wordtype %></td>
<td><%= word.description %></td>
<td><%= link_to 'Show', word %></td>
</tr>
<% end %>
</tbody>
</div>
</table>
【问题讨论】:
-
在发帖时尽量提高好奇心,你有什么解决问题的方法?
-
查看服务器和浏览器日志,可能有错误信息
标签: javascript ruby-on-rails ruby pagination