# Need some help with controlers

**URL:** <https://www.ruby-forum.com/t/need-some-help-with-controlers/105247>\
**Category:** Rails\
**Created:** [May 28, 2007, 12:05am UTC](https://www.ruby-forum.com/t/need-some-help-with-controlers/105247 "2007-05-28T00:05:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [May 28, 2007, 12:05am UTC](https://www.ruby-forum.com/t/need-some-help-with-controlers/105247/1 "2007-05-28T00:05:30Z")

</div>

I am tring to set up a my directory structure for the pages. Right now i  
have /admin/news.rhtml and admin and news are controlers. Now i need to  
make the news section to be the place where i add all the news articals  
in to the site. how do i go about doing this?

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [May 28, 2007, 12:06am UTC](https://www.ruby-forum.com/t/need-some-help-with-controlers/105247/2 "2007-05-28T00:06:37Z")

</div>

Mike wrote:

> I am tring to set up a my directory structure for the pages. Right now i  
> have /admin/news.rhtml and admin and news are controlers. Now i need to  
> make the news section to be the place where i add all the news articals  
> in to the site. how do i go about doing this?

opps news is not a controler but i think i have to make it one. And if  
that is the case how do i make it a controler taht in under another  
controler?

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [May 28, 2007, 2:46am UTC](https://www.ruby-forum.com/t/need-some-help-with-controlers/105247/3 "2007-05-28T02:46:17Z")

</div>

You need to be clear on how things are setup by default and what can  
be changed.

If you are using the standard routes then there is a directory app/  
controllers where your controller files \*.rb live.  
There will also be a directory app/views/ for the  
\*.rhtml and \*.rjs and \*.rxml files that go with that controller.  
For normal operations there will be one of the above files for each  
action on each controller.

The URL you indicated /admin/news would indicate admin as the  
controller and news as the action. If news is really a controller  
the URL would normally be /news or /news/ with index being the  
default action.

I would recommend the book Agile Web D. with Rails as it has  
a very fast intro tutorial in the first few chapters to get you  
oriented, then goes into everything in more detail. The book is well  
written and easy to read.

Michael

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [May 28, 2007, 3:03am UTC](https://www.ruby-forum.com/t/need-some-help-with-controlers/105247/4 "2007-05-28T03:03:35Z")

</div>

Yea I have read half the book. But it dose not do what I am looking for.  
So what I am trying to do is make all my files for updating and adding  
content go thru the admin controller so that my URL always looks like  
your in the admin directory. (example:  
[http://localhost:3000/admin/news/list](http://localhost:3000/admin/news/list)) Is that posible or should i  
create a compleatly new rails project just for the CMS.
