Commit 0c9bc87f authored by azul's avatar azul

cleanup: use LinkRenderer::Page instead of Dispatch

the latter was unused since we changed the routes quite a while ago.
parent 1d670fa8
......@@ -46,7 +46,7 @@ module Common::Application::PaginationOptions
LinkRenderer::ModalAjax :
LinkRenderer::Ajax
else
LinkRenderer::Dispatch
LinkRenderer::Page
end
end
end
#
# This is a link renderer that makes nice URLs for the pagination links when
# we happen to be on a page with a funky dispatch based route.
# eg: /:context/:page
#
class LinkRenderer::Dispatch < LinkRenderer::CrabgrassBase
def url_for(page)
if @template.params[:_context] or @template.params[:_page]
url = ''
url += "/#{@template.params[:_context]}" if @template.params[:_context]
url += "/#{@template.params[:_page]}" if @template.params[:_page]
url += "/#{@options[:params][:action]}" if @options[:params] and @options[:params][:action]
url += "?#{param_name}=#{page}"
# TODO: handle other params in addition to :action.
url
else
super(page)
end
end
end
......@@ -5,8 +5,7 @@
# for example, suppose the request was for /pages/25/posts/create, we still
# create links that look like /:context/:page_name?posts=2
#
# CURRENTLY UNUSED
#
# Used for example to paginate posts on pages.
class LinkRenderer::Page < LinkRenderer::CrabgrassBase
# page --> the pagination page (integer)
# page_object --> the object of class Page
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment