Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   rewriting an URL route in Ruby.. [RoR] (http://www.velocityreviews.com/forums/t843567-rewriting-an-url-route-in-ruby-ror.html)

Josselin 08-25-2007 10:44 AM

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



All times are GMT. The time now is 12:21 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57