【发布时间】:2011-08-01 23:28:52
【问题描述】:
我正在尝试为分页做一些 ajax,但我无法让 index.js.erb 加载或以任何方式被识别。我正在关注railscast 240:https://github.com/ryanb/railscasts-episodes/blob/master/episode-240/store/app/views/products/_products.html.erb
我正在使用下面的代码:
index.js.erb
$("#products").html("<%= escape_javascript(render("products")) %>");
请求似乎正常通过,但没有加载 HTML。没有任何变化(虽然没有错误)
【问题讨论】:
-
Gabriel,报价很好。 Rails 处理 之间的代码。
标签: jquery ruby-on-rails ruby ajax pagination