Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > rewriting an URL route in Ruby.. [RoR]

Reply
Thread Tools

rewriting an URL route in Ruby.. [RoR]

 
 
Josselin
Guest
Posts: n/a
 
      08-25-2007
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(arams => params.merge({age => n})),
:method => :get,
:update => 'table_document'
}
html_options = {:href => franchise_documents_path(arams =>
params.merge({age => 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(arams => params.merge({age => n})),
:url => whatever_documents_url(arams => params.merge({age => n})),

how should I write it ?

thanks for your help

joss

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the default precedence: local-route, static-route,OSPF-route? ilan.berco@gmail.com Cisco 9 08-07-2008 05:42 PM
url rewriting with no extension in url =?Utf-8?B?cmFwaWRkYXRh?= ASP .Net 8 11-02-2006 01:48 PM
route-map question (how to policy route for all destinations except few subnets?) binand@gmail.com Cisco 1 08-13-2005 08:52 PM
Using route-map to route packets coming from different networks. AM Cisco 3 07-25-2005 07:12 AM
url rewriting when the url contains parameters Gaurav Agarwal Java 2 01-31-2005 11:15 AM



Advertisments
 



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