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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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:

http://myapp/start/show?url=xZq
http://myapp/xZq

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

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

Sabon
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
mapped
link..
[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
in
the url itself is out of the question.
unless there's some other way I'm not aware of.

thanks for reply.

Sabon
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.