using master(single) template for all view pages

Hi all i want to use a master template for all my view files to use the rails DRY feature.So How can i achieve that. I already googled it but unfortunately didn't get much help. any help would be appreciated

venkata reddy wrote in post #977331:

Hi all i want to use a master template for all my view files to use the rails DRY feature.

What do you mean by the rails DRY feature? DRY is coding practice not a framework feature.

So How can i achieve that. I already googled it but unfortunately didn't get much help. any help would be appreciated

You use layouts for this. You put the common layout ERb (or HAML) in ./app/views/layouts then put the page specific ERb in ./app/views/<whatever> and use <%= yield %> and/or <%= yield :some_content %> inside the layout templates to mark where the page specific code should be rendered.

Rails will, by convention, look for ./app/layouts/application.html.erb if no other layout is specified.

./app/layouts/application.html.erb

venkata reddy wrote in post #977331:

Hi all i want to use a master template for all my view files to use the rails DRY feature.So How can i achieve that. I already googled it but unfortunately didn't get much help. any help would be appreciated

Are you looking for the use of layouts?

Best,

thank u...very good tutorials..