Forum: Ruby on Rails distinguishing mapped urls from ordinary action urls

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
[s] (Guest)
on 2006-04-13 01:08
(Received via mailing list)
I want to present different view depending on the url.
example below:


both addresses are controlled by a single controller and the same
the second url is only mapped in routes.rb

how can I distinguished the mapped url and present a slightly different
in it?

Emin H. (Guest)
on 2006-04-13 01:11
(Received via mailing list)
in your mapping you can pass a parameter that will indicate this is a
[s] (Guest)
on 2006-04-13 01:14
(Received via mailing list)
I want the mapped url to be as short as possible, so passing a parameter
the url itself is out of the question.
unless there's some other way I'm not aware of.

thanks for reply.

Emin H. (Guest)
on 2006-04-13 01:20
(Received via mailing list)
I was meaning something like this

 map.connect ':link', :controller => 'start', :action => 'show', :url
=> :link, :mapped => '1'
[s] (Guest)
on 2006-04-13 01:42
(Received via mailing list)
I assume :mapped will be stored in the @params?
Henry T. (Guest)
on 2006-04-13 01:48
(Received via mailing list)
Yup, as @params[:mapped]
[s] (Guest)
on 2006-04-13 01:57
(Received via mailing list)
works like charm,
thanks a lot.
This topic is locked and can not be replied to.