当我遇到这个问题时,我正在我的网站上工作,我的博客中有 100 个帖子,我一次将它们分页 10 个,我显示第 15 个并在底部显示一个链接,该链接基本上是使用 link_to_remote 标签实现的.
<%= link_to_remote "More Posts", :url => {:action => 'view' ,:id => link.to_i + 1} , :html => {:id => 'more-link'} %>
我单击它并获取接下来的 15 个帖子,然后通过 insert_html 将其附加到包含第 15 个帖子的容器中
page.insert_html :bottom, :puzzles , :partial => 'puzzles', :object => @puzzles
现在我想要的是页面底部的链接也需要更新,以便下次用户点击更多时获取第三批等等。基本上像
page.replace_html 'more-link', link_to_remote "More Posts", :url => {:action => 'view' ,:id => link.to_i + 1} , :html => {:id => 'more-link'}
关于我该怎么做的任何线索?