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?
on 2007-05-28 00:05
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?
on 2007-05-28 02:46
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
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.