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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/2b80d52e/attachment.html
Emin Hasanov
2006-Apr-12 21:10 UTC
[Rails] distinguishing mapped urls from ordinary action urls
in your mapping you can pass a parameter that will indicate this is a mapped link.. On 4/13/06, [s] <sabon@go2.pl> wrote:> > 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 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/6d5e56b5/attachment-0001.html
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 4/12/06, Emin Hasanov <emin@hasanov.com> wrote:> > in your mapping you can pass a parameter that will indicate this is a > mapped link.. > > On 4/13/06, [s] <sabon@go2.pl> wrote: > > > 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 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/028e6378/attachment.html
Emin Hasanov
2006-Apr-12 21:19 UTC
[Rails] distinguishing mapped urls from ordinary action urls
I was meaning something like this map.connect '':link'', :controller => ''start'', :action => ''show'', :url => :link, :mapped => ''1'' On 4/13/06, [s] <sabon@go2.pl> wrote:> > 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 4/12/06, Emin Hasanov <emin@hasanov.com> wrote: > > > > in your mapping you can pass a parameter that will indicate this is a > > mapped link.. > > > > On 4/13/06, [s] <sabon@go2.pl> wrote: > > > > > 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 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/e6772ccc/attachment-0001.html
I assume :mapped will be stored in the @params? On 4/12/06, Emin Hasanov <emin@hasanov.com> wrote:> > I was meaning something like this > > map.connect '':link'', :controller => ''start'', :action => ''show'', :url => :link, :mapped => ''1'' > > > > On 4/13/06, [s] <sabon@go2.pl> wrote: > > > > 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 4/12/06, Emin Hasanov <emin@hasanov.com> wrote: > > > > > > in your mapping you can pass a parameter that will indicate this is a > > > mapped link.. > > > > > > On 4/13/06, [s] <sabon@go2.pl> wrote: > > > > > > > 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 > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/179e5fa4/attachment.html
Henry Turner
2006-Apr-12 21:47 UTC
[Rails] distinguishing mapped urls from ordinary action urls
Yup, as @params[:mapped] On 4/12/06, [s] <sabon@go2.pl> wrote:> I assume :mapped will be stored in the @params? > > > > On 4/12/06, Emin Hasanov <emin@hasanov.com> wrote: > > > > I was meaning something like this > > > > map.connect '':link'', :controller => ''start'', :action => ''show'', :url => > :link, :mapped => ''1'' > > > > > > > > > > > > On 4/13/06, [s] <sabon@go2.pl> wrote: > > > > > > 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 4/12/06, Emin Hasanov <emin@hasanov.com> wrote: > > > > > > > > in your mapping you can pass a parameter that will indicate this is a > mapped link.. > > > > > > > > > > > > > > > > On 4/13/06, [s] <sabon@go2.pl> wrote: > > > > > > > > > > > > > > > > > > > > > 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 > > > > > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
works like charm, thanks a lot. On 4/12/06, Henry Turner <henryturnerlists@googlemail.com> wrote:> > Yup, as @params[:mapped] > > On 4/12/06, [s] <sabon@go2.pl> wrote: > > I assume :mapped will be stored in the @params? > > > > > > > > On 4/12/06, Emin Hasanov <emin@hasanov.com> wrote: > > > > > > I was meaning something like this > > > > > > map.connect '':link'', :controller => ''start'', :action => ''show'', :url > => > > :link, :mapped => ''1'' > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/f877c678/attachment-0001.html