Mini CMS I tend to follow a very similar pattern when setting up small websites for people. Basically it''s like this for an example site with three pages. Two controllers, Welcome and Pages. --------------- The Welcome controller is simple contains the following really. It contains a "find_by" method to find the page content by the name of the action. I use a before filter to do this before each action. def home end def contact end def links end --------------- Views all contain the same thing. If there''s page content - display it. Pages controller just a normal scaffolded controller to CRUD pages. The title of the page is used as the key to link content to the pages so it needs to match the action names. I set up all my pages in the initial migration with some dummy content. I use the new basic http_authentication built into rails 2 to secure this controller. Then I have a layout for the welcome which generates a menu at the top with links to each action, I need to update this by hand as pages change name or are added or deleted. Basically my approach works fine, just wondering if others use the same type of approach and looking for tips to refine this! A page in my database is again simple title:string, body:text Tips appreciated. Cheers bsp -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Any tips? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Anyone on this. Sorry if I''m a little unclear. Just interested in how others might create a very basic website for people with a backend CMS. The layout file is where I set out my navigation menus, and I need to edit this if the "client" changes the site structure. Sometimes I use "tinymce" to allow the client to format text without having to learn basic html. workflow is roughly. 1. create welcome controller with actions and views for each page 2. create pages scaffolded controller 3. add a page record for each page and some dummy content 4. edit layout for navigation menu 5. edit welcome views to include the page records "content" Am I missing a trick or two? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
In the Learning Rails screencast series, we''re building up a mini-CMS as an example. You can download our code and see the screencasts that walk through it. We don''t use separate actions for each page, but treat the Page as a restful resource and use the name of the page to find the appropriate page contents. We made a separate "viewer" controller to render the page so we could keep the page_controller as the standard scaffolded REST controller. http://www.BuildingWebApps.com/learningrails There''s three screencasts posted now, which create the basic Page model and then add user authentication. The fourth screencast, which will be published Monday, allows pages to be set as admin access only and also automatically creates the navigation. We''ll be further enhancing it in the next couple screencasts. Michael Slater www.BuildingWebApps.com On Apr 24, 1:34 am, bingo bob <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Anyone on this. Sorry if I''m a little unclear. > > Just interested in how others might create a very basic website for > people with a backend CMS. > > The layout file is where I set out my navigation menus, and I need to > edit this if the "client" changes the site structure. > > Sometimes I use "tinymce" to allow the client to format text without > having to learn basic html. > > workflow is roughly. > > 1. create welcome controller with actions and views for each page > 2. create pages scaffolded controller > 3. add a page record for each page and some dummy content > 4. edit layout for navigation menu > 5. edit welcome views to include the page records "content" > > Am I missing a trick or two? > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Slater wrote:> In the Learning Rails screencast series, we''re building up a mini-CMS > as an example. You can download our code and see the screencasts that > walk through it. We don''t use separate actions for each page, but > treat the Page as a restful resource and use the name of the page to > find the appropriate page contents. We made a separate "viewer" > controller to render the page so we could keep the page_controller as > the standard scaffolded REST controller. > > http://www.BuildingWebApps.com/learningrails > > There''s three screencasts posted now, which create the basic Page > model and then add user authentication. The fourth screencast, which > will be published Monday, allows pages to be set as admin access only > and also automatically creates the navigation. We''ll be further > enhancing it in the next couple screencasts. > > Michael Slater > www.BuildingWebApps.com > > On Apr 24, 1:34 am, bingo bob <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Michael, Your site is a wonderful resource, I listened to the audio stuff this morning and it really helped cement my knowledge. I''ve subscribed and I''ll be tuning in. I liked the IDE/simple editor debate. For the record I''m a textmate man, :-). cheers bb -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---