[Nitro] Nitro: cannot control the current path of a controller when skins are called

Jimmy Jazz Jimmy.Jazz at gmx.net
Tue Jun 26 17:02:41 EDT 2007


Jonathan Buch a écrit :
> Hi,
> 
>> I'm new to nitro and ruby :)
> 
> just on short notice (I hope I read your post correct, I was slightly
> in a hurry):
> 
> cwd = File.dirname(__FILE__)
> 
> require "#{cwd}/deed/email"
> require "#{cwd}/deed/sms"
> 
> This is what I do in 'subprojects'.  It doesn't look that nice, but
> it works for me and doesn't clutter the load path.
> 
> Jo
> 

Thanks for your fast reply, and sorry if i didn't make myself clear :)

Actually nitro find all the files it needs but when you call a "skin"
except for the 'src/skin', the program will stop to be consistent with
Server.map

For instance, if you have an object like:

def to_href
    "category/#@oid"
end

in src/models/blog.rb  and in the meantime have called (required) a skin
in src/controllers/blog.rb or in run.rb, you will get a wrong path
for to_href: http://yourserver:9000/category/1

Also, if you remove every lines "require 'somepathto/skin'" in
'src/controllers/blog.rb' and in run.rb (ex: require 'src/skins/blog" )

the "default" path for the controller will then be restored to the right
value:

http://yourserver:9000/blog/category/1

A simple call to a skin will modify the "home"
directory of the controller and default it to '/' despite what is
declared in Server.map.

Jj

-- 

            |\      _,,,---,,_
      ZZZzz /,`.-'`'    -.  ;-;;,_
           |,4-  ) )-,_. ,\ (  `'-'
          '---''(_/--'  `-'\_)




More information about the Nitro-general mailing list