logo       

Re: R() in controllers: msg#00038

lang.ruby.camping.general

Subject: Re: R() in controllers

On Wed, Nov 29, 2006 at 10:00:52AM +0000, Adam Harper wrote:
> Paul van Tilburg wrote:
> > Here I use R(Foo, bar) in views to link to controller foo, this correctly
> > creates a /test/foo/bar link. However, when I use R() in some controller,
> > for example:
> >
> > headers['Refresh'] = "60; url=#{R(Foo, bar)}"
> >
> > The generated link is /foo/bar, which obviously links to something
> > non-existant. Can somebody affirm that R() in controllers do not
> > work correctly?
>
> I don't think it's working incorrectly -- just a little unintuitively.
> In short, R() only prepends the app root (i.e. '/test') to the
> generated URL when called from within a View -- not Controllers.

Yes, I see what you mean. Thanks for pointing that out. Indeed,
you assume it is going to behave the same.

Kind regards,
Paul

--
Student @ Eindhoven | email:
paul-FGvqe4uplSY@xxxxxxxxxxxxxxxx
University of Technology, The Netherlands | JID:
paul-FGvqe4uplSY@xxxxxxxxxxxxxxxx
>>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise