# Directory structure on typo

**URL:** <https://www.ruby-forum.com/t/directory-structure-on-typo/62419>\
**Category:** Rails\
**Created:** [June 4, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/directory-structure-on-typo/62419 "2006-06-04T15:21:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 4, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/directory-structure-on-typo/62419/1 "2006-06-04T15:21:37Z")

</div>

i was looking through the typo code and see that all of the  
administrative controllers and views are placed in another subfolder. i  
tried just moving the files just for kicks and it didn’t work (didin’t  
really expect it to, but it was worth a shot.)

so how do you set something up like that? i tried looking in the  
routes.rb file, but i’im not sure what’s in there that i would need and  
what i wouldn’t, plus i’m really trying to learn this and how things  
work instead of just copying and pasting other people’s code.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 4, 2006, 3:29pm UTC](https://www.ruby-forum.com/t/directory-structure-on-typo/62419/2 "2006-06-04T15:29:29Z")

</div>

When creating the controllers, etc… if you add the path information  
it will be done for you. So for example, if you type:

script\generate controller Admin/Account show

You will end up with a directory structure that has  
/app/controllers/admin/account\_controller.rb and  
/app/views/admin/show.rhtml

Michael

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 4, 2006, 3:32pm UTC](https://www.ruby-forum.com/t/directory-structure-on-typo/62419/3 "2006-06-04T15:32:59Z")

</div>

Also remember that if you create controllers like ‘admin/user’,  
‘admin/messages’ you will not be able to create a controller called  
just ‘admin’ as that will confuse rails. Instead you create a  
controller like ‘admin/base’ and make a route to map [site.com/admin](http://site.com/admin) to  
[site.com/admin/base](http://site.com/admin/base)

On 6/4/06, Michael T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 4, 2006, 3:47pm UTC](https://www.ruby-forum.com/t/directory-structure-on-typo/62419/4 "2006-06-04T15:47:31Z")

</div>

JÃ³n BorgÃ¾Ã³rsson wrote:

> Also remember that if you create controllers like ‘admin/user’,  
> ‘admin/messages’ you will not be able to create a controller called  
> just ‘admin’ as that will confuse rails. Instead you create a  
> controller like ‘admin/base’ and make a route to map [site.com/admin](http://site.com/admin) to  
> [site.com/admin/base](http://site.com/admin/base)
> 
> On 6/4/06, Michael T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > * * *
> > 
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> –

that probably would have been my next question. thanks for the help!

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [June 4, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/directory-structure-on-typo/62419/5 "2006-06-04T15:46:52Z")

</div>

Michael T. wrote:

> When creating the controllers, etc… if you add the path information  
> it will be done for you. So for example, if you type:
> 
> script\generate controller Admin/Account show
> 
> You will end up with a directory structure that has  
> /app/controllers/admin/account\_controller.rb and  
> /app/views/admin/show.rhtml
> 
> Michael

i didn’t think about doing that when the controller was created. that’s  
prlly why mine wasn’t working. thanks.
