The one page to rule them all

Hello all,
I just found out that I could set a default layout for my pages.
However, I’ve already created dozens of pages that don’t use that
default layout. What would be the easiest way to get these pages into
the new scheme? I’ve done very little layout work on them, would it be
easiest to simply regenerate them?

Thanks,
Will G.


How low will we go? Check out Yahoo! MessengerÂ?s low PC-to-Phone call
rates.

Dear Will:

If I understood your question properly, you are saying that before
discovering layouts, you have a bunch of pages like:

My page title

and now you have discovered that creating application.rhtml in the
layouts directory will give you a layout you can use on any page,
something like:

<%= @page_title %> <%= @content_for_layout %>

I think the best thing to do is to use two tools… source control and
a file comparison utility like Beyond Compare. Source control so you
can always rollback changes if things don’t look like, and beyond
compare to make sure you have captured everything… From looking at
AWDWR 1st ed, p. 370, another thing you might want to do is create new
controllers for where all these new views are going to go, and you might
want to use the controller syntax described to prevent the layout from
being applied in your existing pages…

That is, if your controller you write:
layout “mylayout”, :except =>[:action1, :action2]

Then all your pages except those listed in the array will use the
layout. You could use this mechanism as you update each page - that is,
make sure the layout not being applied, change the page, then apply the
layout…

Hope this helps!
Dominique
Will G. wrote:

Hello all,
I just found out that I could set a default layout for my pages.
However, I’ve already created dozens of pages that don’t use that
default layout. What would be the easiest way to get these pages into
the new scheme? I’ve done very little layout work on them, would it be
easiest to simply regenerate them?

Thanks,
Will G.


How low will we go? Check out Yahoo! MessengerÂ?s low PC-to-Phone call
rates.

Thanks, that fixed it.

Dominique P. [email protected] wrote:
Dear Will:

If I understood your question properly, you are saying that before
discovering layouts, you have a bunch of pages like:

My page title

and now you have discovered that creating application.rhtml in the
layouts directory will give you a layout you can use on any page,
something like:

<%= @page_title %>

<%= @content_for_layout %>

I think the best thing to do is to use two tools… source control and
a file comparison utility like Beyond Compare. Source control so you
can always rollback changes if things don’t look like, and beyond
compare to make sure you have captured everything… From looking at
AWDWR 1st ed, p. 370, another thing you might want to do is create new
controllers for where all these new views are going to go, and you might
want to use the controller syntax described to prevent the layout from
being applied in your existing pages…

That is, if your controller you write:
layout “mylayout”, :except =>[:action1, :action2]

Then all your pages except those listed in the array will use the
layout. You could use this mechanism as you update each page - that is,
make sure the layout not being applied, change the page, then apply the
layout…

Hope this helps!
Dominique
Will G. wrote:


How low will we go? Check out Yahoo! MessengerÂ?s low PC-to-Phone call
rates.


Posted via http://www.ruby-forum.com/.


Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs