Forum: Ruby on Rails Question about nested views and layouts

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
76c0ba00aeb7b0951cb705f157a1b119?d=identicon&s=25 wcheung (Guest)
on 2007-02-10 01:55
(Received via mailing list)

I'm new to RoR, and I'm confused on how nested views work.  This is
what I have set up:



/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

BTW, I generated scaffold like the following:

script/generate scaffold product store/products
script/generate scaffold service store/services

Thanks in advance.
65cf838378fb068035070ffe60c76e97?d=identicon&s=25 (Guest)
on 2007-02-10 02:08
(Received via mailing list)
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 :)
This topic is locked and can not be replied to.