Rewriting an URL route in Ruby.. [RoR]

right now I am using an an helper action like that

def document_pagination_links_remote(paginator)
    page_options = {:window_size => 1}
    pagination_links_each(paginator, page_options) do |n|
      options = {
        :url => franchise_documents_url(:params => params.merge({:page => n})),
        :method => :get,
        :update => 'table_document'
      }
      html_options = {:href => franchise_documents_path(:params => params.merge({:page => n}), :method => :get)}
      link_to_remote(n.to_s, options, html_options)
    end
  end

I need to rewrite the url, according to a string as a parameter 'container' container = "franchise" or "whatever"

def document_pagination_links_remote(paginator, container)
.... depending upon container string
  :url => franchise_documents_url(:params => params.merge({:page => n})),
  :url => whatever_documents_url(:params => params.merge({:page => n})),

how should I write it ?

thanks for your help

joss