[Nitro] BUG: Using Nitro::Controller as main controller breaks template_root

Chris Farmiloe chris at motionpath.com
Tue Dec 20 11:49:29 EST 2005


sorry Zimba still cant find fault.

I changed the index.xhtml file in the /child dir
(so I could see which template it was using)
and visiting /, /index, /child and /child/index
all gave me the correct templates.



removing the index.xhtml from public/child dir
does make the template default back to the one
in public.

this behaviour is because if nitro failed to find a
template in /child (ChildController's default template_root)
it will look in it's parent's template_root. normally
Nitro::Controller (ChildController's parent) wouldn't have a
template_root... but dispatcher gave it one when it was Mounted
directly.


sorry I can't be of more help, can't replicate :(




Chris Farmiloe


On 20 Dec 2005, at 16:27, zimba-tm wrote:

> Here are the files to reproduce the bug.
>
> Put index.xhtml in public/ and public/child/.
>
> On 20/12/05, zimba-tm <zimba.tm at gmail.com> wrote:
>> Hi Chris,
>>
>> I'm using glycerin at the moment. But I didn't had time to really  
>> test
>> this behavior. I'll try to come up with a test case today.
>>
>>
>> On 19/12/05, Chris Farmiloe <chris at motionpath.com> wrote:
>>>
>>> Can't seem to replicate this zimba? I get taken to the correct  
>>> xhtml.
>>>
>>> what version are you using?
>>>
>>>
>>>
>>> chrisfarms.
>>>
>>>
>>>
>>> On 19 Dec 2005, at 21:38, zimba-tm wrote:
>>>
>>> Sorry I don't have the time to debug this right now but I still  
>>> wantto
>>> report it.
>>> ========== test case =========
>>> require 'nitro'
>>> class MainController < Nitro::Controllerend
>>> class ChildController < Nitro::Controllerend
>>> Nitro::Server.map = {  '/child' => ChildController,  '/' =>  
>>> MainController}
>>> Nitro.run
>>> =========================
>>> === pulic folder ===index.xhtmlchild/  index.xhtml============
>>> Replace MainController with Nitro::Controller in Server.map.Goto to
>>> http://localhost:9999/child with your browser.
>>> nitro will use public/index.xhtml instead of public/child/ 
>>> index.xhtml
>>> --Cheers,  zimba
>>> http://zimba.oree.ch
>>> _______________________________________________
>>> Nitro-general mailing list
>>> Nitro-general at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/nitro-general
>>>
>>> _______________________________________________
>>> Nitro-general mailing list
>>> Nitro-general at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/nitro-general
>>>
>>>
>>>
>>
>>
>> --
>> Cheers,
>>   zimba
>>
>> http://zimba.oree.ch
>>
>
>
> --
> Cheers,
>   zimba
>
> http://zimba.oree.ch
> <run.rb>
> <index.xhtml>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20051220/3efce0da/attachment.html 


More information about the Nitro-general mailing list