Forum: Ruby on Rails Need some help with controlers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ecbbb234be8e9061b1a8c319e3f9fa6d?d=identicon&s=25 Mike (Guest)
on 2007-05-28 00:05
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?
Ecbbb234be8e9061b1a8c319e3f9fa6d?d=identicon&s=25 Mike (Guest)
on 2007-05-28 00:06
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?
588ab1c0a5610a7e160a3b101abb91e6?d=identicon&s=25 MichaelLatta (Guest)
on 2007-05-28 02:46
(Received via mailing list)
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/<controllername> 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/<action> with index being the
default action.

I would recommend the book Agile Web Development 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
Ecbbb234be8e9061b1a8c319e3f9fa6d?d=identicon&s=25 Mike (Guest)
on 2007-05-28 03:03
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) Is that posible or should i
create a compleatly new rails project just for the CMS.
This topic is locked and can not be replied to.