Permalink
Browse files

rats, Merb url(:this) doesn't include GET params? reverting. also, do…

…n't document :base_url just yet
  • Loading branch information...
mislav committed Nov 9, 2008
1 parent 4906f79 commit d835e46525cf46aaf14f53dbb1ceb0628ce56917
Showing with 6 additions and 3 deletions.
  1. +0 −2 lib/will_paginate/view_helpers/base.rb
  2. +6 −1 lib/will_paginate/view_helpers/merb.rb
@@ -18,8 +18,6 @@ module Base
# * <tt>:param_name</tt> -- parameter name for page number in URLs (default: <tt>:page</tt>)
# * <tt>:params</tt> -- additional parameters when generating pagination links
# (eg. <tt>:controller => "foo", :action => nil</tt>)
- # * <tt>:base_url</tt> -- specify the action url, the helper will only add the page # attribute
- # to the url
# * <tt>:renderer</tt> -- class name, class or instance of a link renderer (default:
# <tt>WillPaginate::LinkRenderer</tt>)
# * <tt>:page_links</tt> -- when false, only previous/next links are rendered (default: true)
@@ -5,7 +5,12 @@
protected
def url(page)
- @template.url(:this, :page => page)
+ if @options[:base_url]
+ "#{@options[:base_url]}?#{param_name}=#{page}"
+ else
+ # soon to be replaced by @template.url(:this, :page => page)
+ @template.url(@template.request.route.name, @template.request.params.except(:action, :controller).merge(:page => page))
+ end
end
end

0 comments on commit d835e46

Please sign in to comment.