# Difference between development/production environments from extensions point of view

**URL:** <https://www.ruby-forum.com/t/difference-between-development-production-environments-from-extensions-point-of-view/129366>\
**Category:** Radiant CMS\
**Created:** [February 17, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/difference-between-development-production-environments-from-extensions-point-of-view/129366 "2008-02-17T18:56:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![131313](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/1/da6949/32.png) [@131313](https://www.ruby-forum.com/u/131313)\
**Post date:** [February 17, 2008, 6:56pm UTC](https://www.ruby-forum.com/t/difference-between-development-production-environments-from-extensions-point-of-view/129366/1 "2008-02-17T18:56:05Z")

</div>

Hi,

I’m developing a new extension for radiant. I have created a  
controller which is a subclass of Admin::AbstractModelController like  
this:

class PostsController \< Admin::AbstractModelController  
model\_class Post

# …

end

Posts controller is mapped to a new tab in the admin interface. When I  
click this tab list of items is displayed.

In development environment everything is working as I want, but when I  
try to run the same extension in production environment I get  
following error:

uninitialized constant Admin::PostsController

I checked environment specific configuration files, but haven’t found  
anything suspicions.

Any help on how to fix this issue will be appreciated.

Regards,  
Martins Grunskis

---

<div class="post-metadata">

**Author:** ![131313](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/1/da6949/32.png) [@131313](https://www.ruby-forum.com/u/131313)\
**Post date:** [February 17, 2008, 8:06pm UTC](https://www.ruby-forum.com/t/difference-between-development-production-environments-from-extensions-point-of-view/129366/2 "2008-02-17T20:06:53Z")

</div>

Sounds like your routes are messed up. Does your route definition look  
like this?

map.connect ‘admin/posts/:action/:id’, :controller =\> “admin/posts”

Make sure that your namespacing is correct.

Sean

---

<div class="post-metadata">

**Author:** ![131313](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/1/da6949/32.png) [@131313](https://www.ruby-forum.com/u/131313)\
**Post date:** [February 17, 2008, 10:25pm UTC](https://www.ruby-forum.com/t/difference-between-development-production-environments-from-extensions-point-of-view/129366/3 "2008-02-17T22:25:56Z")

</div>

Thanks, that helped. Now my controllers are in Admin namespace:

class Admin::PostsController \< Admin::AbstractModelController  
#…  
end

But I find it strange, that everything worked in development mode. Why  
it’s that way?

This piece of code that I borrowed from page\_attachements [1](http://dev.radiantcms.org/svn/radiant/trunk/extensions/page_attachments/app/models/observe_page_attachments.rb) also is  
working only in development environment! I’ve checked if it’s only  
that way in my extension, but no - page\_attachments has the same  
bug… Any ideas?

Thanks,  
Martins Grunskis
