Hi, I''m new to RoR, and I''m confused on how nested views work. This is what I have set up: /store/products_controller.rb /store/services_controller.rb /views/layouts/products.rhtml /views/layouts/services.rhtml /views/layouts/store.rhtml /views/store/product/edit.rhtml (and new.rhtml, list.rhtml, etc created by scaffold) /views/store/service/edit.rhtml (also created by scaffold) So when I change the "master" page format in /views/layouts/ products.rhtml, it should be reflected on views/store/product/ list.rhtml, right? I added some links and "hello world" in <body> but nothing showed up. I went to view source on the ''list'' page and I don''t even see the <html> or <body> tags in products.rhtml. Of course, modifications in the views itself is reflected correctly. I''m wondering if I''m even doing this correctly. Any advice is appreciated. BTW, I generated scaffold like the following: script/generate scaffold product store/products script/generate scaffold service store/services Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jamiequint-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-10 01:07 UTC
Re: Question about nested views and layouts
This is a rather hacky way to do things if all you are trying to do is put "store" in the url. Instead, create the controllers and views normally (don''t nest them under "store") and set up a route for your application in routes.rb (config/routes.rb) to expect "store". Good Luck :) On Feb 9, 4:53 pm, "wcheung" <indiffere...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I''m new to RoR, and I''m confused on how nested views work. This is > what I have set up: > > /store/products_controller.rb > /store/services_controller.rb > > /views/layouts/products.rhtml > /views/layouts/services.rhtml > /views/layouts/store.rhtml > > /views/store/product/edit.rhtml (and new.rhtml, list.rhtml, etc > created by scaffold) > /views/store/service/edit.rhtml (also created by scaffold) > > So when I change the "master" page format in /views/layouts/ > products.rhtml, it should be reflected on views/store/product/ > list.rhtml, right? I added some links and "hello world" in <body> but > nothing showed up. I went to view source on the ''list'' page and I > don''t even see the <html> or <body> tags in products.rhtml. Of > course, modifications in the views itself is reflected correctly. I''m > wondering if I''m even doing this correctly. Any advice is > appreciated. > > BTW, I generated scaffold like the following: > > script/generate scaffold product store/products > script/generate scaffold service store/services > > Thanks in advance.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---