Rewriting an URL route in Ruby

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)

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 =>
:url => whatever_documents_url(:params => params.merge({:page => n})),

how should I write it ?

thanks for your help


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs