Ooooh, I''m having so much fun with Ruby on Rails. I have the students assigning to parents, the parents are able to come login... it''s great. That''s the functional part. As I get more of it working I am sure I''ll have questions about that. Until then: What do I do for the "static" files on the site. For every site you build don''t you have an "About" a "Contact" and "Help" page? Things right off the root? Right now I have them in the Application directory and a route points ''/:action'' to :controller => Application (or something like that, I''m home now instead of in my office). I want them to all have the layout from the rest of the site, obviously. Is there a usual method for this? Thanks, --Colin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I have the students assigning to parents, the parents are able to come > login... it''s great.Rails rules like no web platform has ruled before. Welcome to the inner circle who no longer need to be told that! Now how are your unit tests?> What do I do for the "static" files on the site. For every site you > build don''t you have an "About" a "Contact" and "Help" page? Things > right off the root? Right now I have them in the Application directory > and a route points ''/:action'' to :controller => Application (or > something like that, I''m home now instead of in my office).I never heard of the Application object used directly as a controller. Put them in the most convenient app/view/controller/ folder, and name them all .rhtml. Don''t bother to write their actions, and access them by default route - /controller/help, /controller/contact, etc. Or put them, as raw html, in /public/, and link to them from /. But this requires the .html extension, which is tacky. -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Oct 16, 2007, at 10:37 PM, Colin Summers wrote:> Ooooh, I''m having so much fun with Ruby on Rails. > > I have the students assigning to parents, the parents are able to come > login... it''s great. > > That''s the functional part. As I get more of it working I am sure I''ll > have questions about that. > > Until then: > > What do I do for the "static" files on the site. For every site you > build don''t you have an "About" a "Contact" and "Help" page? Things > right off the root? Right now I have them in the Application directory > and a route points ''/:action'' to :controller => Application (or > something like that, I''m home now instead of in my office). > > I want them to all have the layout from the rest of the site, > obviously. > > Is there a usual method for this?My understanding is you still need to (or normally would) use controller/action. So if you put those at /company/about, /company/contact you would still create a Company controller, it just wouldn''t do very much. As for giving all pages the same look, I''ve been exploring how to do this in Rails, and just finished writing an article about it (still some unanswered questions, but I''ll get to those). http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in- ruby-on-rails/ -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
you can also set up a layout in apps/views/layouts/ and put your html template there then in the controller you want to share this template put layout "nameoflayout" make sure you have a yield :layout where you want the specific methods to show up in. For instance my admin controller shares one layout and each action or method is displayed or "yielded" at the specific point on the layout where I want. Which in my case is in my div#content box. Typing this on my palm omw home. Write back if you have any questions. Thomas england -----Original Message----- From: Greg Willits <lists-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> Date: Tuesday, Oct 16, 2007 7:52 pm Subject: [Rails] Re: Basic Question about Base Files To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF4jLi/XSEFGl@public.gmane.org: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org On Oct 16, 2007, at 10:37 PM, Colin Summers wrote:> Ooooh, I''m having so much fun with Ruby on Rails.> I have the students assigning to parents, the parents are able to comelogin... it''s great.> That''s the functional part. As I get more of it working I am sure I''llhave questions about that.> Until then:> What do I do for the "static" files on the site. For every site youbuild don''t you have an "About" a "Contact" and "Help" page? Things right off the root? Right now I have them in the Application directory and a route points ''/:action'' to :controller => Application (or something like that, I''m home now instead of in my office).> I want them to all have the layout from the rest of the site,obviously.> Is there a usual method for this?My understanding is you still need to (or normally would) use controller/action. So if you put those at /company/about, /company/contact you would still create a Company controller, it just wouldn''t do very much. As for giving all pages the same look, I''ve been exploring how to do this in Rails, and just finished writing an article about it (still some unanswered questions, but I''ll get to those). http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in- ruby-on-rails/ -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ugh I also wanted to ask why would you need a controller for all your actions if they''re relatively static. Just throw your static pages in railsapp/public thomas england -----Original Message----- From: Greg Willits <lists-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> Date: Tuesday, Oct 16, 2007 7:52 pm Subject: [Rails] Re: Basic Question about Base Files To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF4jLi/XSEFGl@public.gmane.org: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org On Oct 16, 2007, at 10:37 PM, Colin Summers wrote:> Ooooh, I''m having so much fun with Ruby on Rails.> I have the students assigning to parents, the parents are able to comelogin... it''s great.> That''s the functional part. As I get more of it working I am sure I''llhave questions about that.> Until then:> What do I do for the "static" files on the site. For every site youbuild don''t you have an "About" a "Contact" and "Help" page? Things right off the root? Right now I have them in the Application directory and a route points ''/:action'' to :controller => Application (or something like that, I''m home now instead of in my office).> I want them to all have the layout from the rest of the site,obviously.> Is there a usual method for this?My understanding is you still need to (or normally would) use controller/action. So if you put those at /company/about, /company/contact you would still create a Company controller, it just wouldn''t do very much. As for giving all pages the same look, I''ve been exploring how to do this in Rails, and just finished writing an article about it (still some unanswered questions, but I''ll get to those). http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in- ruby-on-rails/ -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 10/17/07, Colin Summers <bladenut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Ooooh, I''m having so much fun with Ruby on Rails. > > I have the students assigning to parents, the parents are able to come > login... it''s great. > > That''s the functional part. As I get more of it working I am sure I''ll > have questions about that. > > Until then: > > What do I do for the "static" files on the site. For every site you > build don''t you have an "About" a "Contact" and "Help" page? Things > right off the root? Right now I have them in the Application directory > and a route points ''/:action'' to :controller => Application (or > something like that, I''m home now instead of in my office).I think it''s a good idea to use a single controller for all these, but don''t use ''application'', since that''s a base class for your other controllers. Call it ''static'' or something. You can use caching on these pages if they are truly static. Also, use named routes instead of a catch-all route. map.about ''/about'', :controller => ''static'', :action => ''about'' map.help ''/help'', :controller => ''static'', :action => ''help'' Then in your view you can write: <%= link_to ''About Us'', about_url %> Makes it *real* easy to reorganize your URL''s without having to track down all your link_to''s> > I want them to all have the layout from the rest of the site, > obviously.If your layout is in layouts/application.rhtml, you don''t have to do anything. Otherwise, you need to specify the layout in your StaticController. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---