I was working on my website when I cam across this problem, I have 100 posts in my blog and I am paginating them 10 at a time, I display the 1st 15 and display a link at the bottom which basically is implemented using the link_to_remote tag.
<%= link_to_remote "More Posts", :url => {:action => 'view' ,:id => link.to_i + 1} , :html => {:id => 'more-link'} %>
I click on that and get the next 15 posts, and append it to the container containing the 1st 15 posts through insert_html
page.insert_html :bottom, :puzzles , :partial => 'puzzles', :object => @puzzles
Now what I want is the link at the bottom of the page to update too, so that the next time the user clicks more the 3rd batch is fetched and so on. Basically something like
page.replace_html 'more-link', link_to_remote "More Posts", :url => {:action => 'view' ,:id => link.to_i + 1} , :html => {:id => 'more-link'}
Any clues as to how I can do it?