Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Simple Ajax Paging (See related posts)

<% if @lesson_pages.current.previous -%>
<%= link_to_remote 'Previous page',
:url => { :page => @lesson_pages.current.previous },
:update => 'my_div',
:loading => "Toggle.display('spinner');"
%>
<% end -%>

This assumes that your paging links are inside the DIV that is being replaced by the Ajax call.

I'll leave 'next' as an exercise for the reader.

Comments on this post

technoweenie posts on Sep 09, 2005 at 01:16
that would make a nice helper.. link_to_remote_next and pref

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts