# Namespace problem

**URL:** <https://www.ruby-forum.com/t/namespace-problem/60065>\
**Category:** Engines\
**Created:** [May 9, 2006, 10:14pm UTC](https://www.ruby-forum.com/t/namespace-problem/60065 "2006-05-09T22:14:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![masschel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/aca169/32.png) [@masschel](https://www.ruby-forum.com/u/masschel)\
**Post date:** [May 9, 2006, 10:14pm UTC](https://www.ruby-forum.com/t/namespace-problem/60065/1 "2006-05-09T22:14:23Z")

</div>

Hello,

I wanted to convert an Engine (in casu the RikiEngine) into namespaces,  
to avoid naming clashes. I did this as I thought it should be done: I  
created in the view, model and controller directory seperate riki\_engine  
directories, and renamed the classes to for instance

class RikiEngine::LibraryController \< ApplicationController

Everything seems to work, but until I try to access a method which is  
defined in the riki\_engine directory under lib (the  
riki\_engine\_helper.rb). In there things are defined as:

module RikiEngine  
def foo  
end  
end

When I call foo from a controller method, or from within a view, it is  
unknown, whereas previously, there was no problem. So obviously there is  
a namespace problem here. I tried several things, without success.  
Mainly because I don’t get the bottom line of namespace yet. Can  
somebody shed a light on this problem, if only the solution?

And related to this problem, what is the opinion on putting engines  
immediately in their own namespace? Don’t get me wrong, I don’t mind  
doing it manually, and I can imagine that automating this might be more  
difficult, in comparison to the two minutes of doing it manually.

Thanks!

Bart

---

<div class="post-metadata">

**Author:** ![masschel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/aca169/32.png) [@masschel](https://www.ruby-forum.com/u/masschel)\
**Post date:** [May 14, 2006, 11:36pm UTC](https://www.ruby-forum.com/t/namespace-problem/60065/2 "2006-05-14T23:36:27Z")

</div>

It’s very unlikely that there will ever be any kind of ‘automatic  
namespacing’ provided with by the Engines plugin; less magic and  
behaviour which is consistent with the rest of Rails is always  
preferable.
