rewriting an URL route in Ruby.. [RoR]

J

Josselin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top