Routing Problems

Hi everybody,

I’ve developed an extension that display a list of
links, taken from a database table, in a page of my site called

By clickking on the title of a link a “singlelink”
page will be opened.

In this page is displayed a description of
the link.

To select the single link I’ ve created a

This tag pass the “link id” by the URL and another
tag get the id from the URL and select the record from the db

This is the code of my tags:

“links:each:link_to_single” do |tag|
curURL =


tag “links:single” do |tag|
content =
curId =
lnk = Link.find_by_id
tag.locals.lnk = lnk

content << tag.expand


With this tags I form url like: /en/singlelink?id=2

It works
very well, but now I’ve got problems with the cache. I’ve read some
about Rails Caching and I’ve learned that I must form url like this:

I’ve tryed to change the tag “link_to_single” in this way:

tag “links:each:link_to_single” do
curURL = request.request_uri


But now radiant reads the id in the URL /en/singlelink/2 like a page
slug, and it renders a page not found error.

I also tryed to modify the radiant routes.rb file adding in the part
Site URL:

map.with_options(:controller => ‘site’) do |site|
site.singlelink ‘it/links/singlelink/:id’,
:action => ‘show_page’

But it dosen’t work.

Is there someone who can explain me how can I compose the URL passing an
id directly after the " / " ?

Thanks everybody.

Taddei Fabrizio


L’email della prossima generazione? Puoi averla con la nuova Yahoo!

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