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

George Moschovitis george.moschovitis at gmail.com
Wed Jun 27 05:56:01 EDT 2007


Jim,

may I suggest that you pull the latest repository version of Nitro:

darcs get http://repo.nitroproject.org

then have a look at examples/blog

to see how a Nitro application should (not must) be structured. I am sure
this will help you get more familiar with Nitro. If you use the latest
version I wll be able to help you more effectively.

best regards,
George.



On 6/26/07, Jimmy Jazz <Jimmy.Jazz at gmx.net> wrote:
>
>  Hello list,
>
> I'm new to nitro and ruby :)
>
> I'm trying to build a little site with nitro, but i'm unable to control
> the current path of a controller. There is something wrong when skins are
> called.
>
> The following example is certainly not the best way to use nitro, but it
> describes the issue pretty well. I don't use part because the skins and the
> models/controllers are too interdependent from each other.
>
> The idea was to group files by family and to avoid them to be all placed
> in src or in templates directory. More generic and sharable files will stay
> in /. Like an example, i will integrate a blog or whatever in a site. Also,
> the directories are organised like that,
>
> src/  for generic controllers, skin modules, etc.
>
> src/controllers/blog.rb
> src/models/blog.rb
> src/helpers/blog.rb
> src/skins/blog.rb
> templates/blog/
>
> (blog.rb files are of course different)
>
> in run.rb i have declared,
>
> require 'src/controller'
> require 'src/controllers/blog'
>
> the blog controller src/controllers/blog.rb, contains,
>
> require 'src/models/blog
> #require 'src/skins/blog     <---------- that's is what will blow the site
> ;)
>
> and run.rb,
>
> require 'src/controller'
> require 'src/controllers/blog'
> #require 'src/skins/blog     <---------- the same appends if declared in
> run.rb :(
>
> Server.map = {
>   '/'     => SiteController,
>   '/blog' => blogController,
>   }
>
>
> As far as i understood, if a controller is relative to /path it will be
> the same for the models ( for example, def to_href "article/#@oid" end) it
> depends on. But that is not always true, for example, if i simply add
> "require 'src/skins/blog' in run.rb or in src/controllers/blog.rb, the
> relative pathname for blog.rb family are then mapped to / and not to the
> current directory /blog according to the "Server.map" mapping.
>
>
> Thanks for your help,
>
> Jj
>
> --
>
>             |\      _,,,---,,_
>       ZZZzz /,`.-'`'    -.  ;-;;,_
>            |,4-  ) )-,_. ,\ (  `'-'
>           '---''(_/--'  `-'\_)
>
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>



-- 
http://phidz.com
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070627/5c3312c8/attachment.html 


More information about the Nitro-general mailing list