Distinguishing mapped urls from ordinary action urls


#1

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


#2

in your mapping you can pass a parameter that will indicate this is a
mapped
link…


#3

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


#4

I was meaning something like this

map.connect ‘:link’, :controller => ‘start’, :action => ‘show’, :url
=> :link, :mapped => ‘1’


#5

I assume :mapped will be stored in the @params?


#6

works like charm,
thanks a lot.


#7

Yup, as @params[:mapped]