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
on 2006-04-12 23:08
on 2006-04-12 23:11
in your mapping you can pass a parameter that will indicate this is a mapped link..
on 2006-04-12 23:14
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
on 2006-04-12 23:20
I was meaning something like this map.connect ':link', :controller => 'start', :action => 'show', :url => :link, :mapped => '1'
on 2006-04-12 23:42
I assume :mapped will be stored in the @params?
on 2006-04-12 23:48
Yup, as @params[:mapped]
on 2006-04-12 23:57
works like charm, thanks a lot.