script/plugin install svn://errtheblog.com/svn/plugins/will_paginate 


Model -> Controller
http://hideto.javaeye.com/blog/108118

Ajax
http://www.letrails.cn/archives/07-10-25-ajax-will-paginate

def will_paginate_remote(paginator, options={})
  update = options.delete(:update)
  url = options.delete(:url)
  str = will_paginate(paginator, options)
  if str != nil
    str.gsub(/href="(.*?)"/) do
      "href=\"#\" onclick=\"new Ajax.Updater('" + update + "', '" + (url ? url + $1.sub(/[^\?]*/, '') : $1) +
      "', {asynchronous:true, evalScripts:true, method:'get',}); return false;\""
    end
  end
end


will_paginate_remote(feeds, :param_name => 'feed_page', :update=>'feed-list', :url=>"/feeds/list")
评论
发表评论

您还没有登录,请登录后发表评论

toostupid
搜索本博客
博客分类
最近加入圈子
存档
最新评论