# Generate a page and save as HTML

**URL:** <https://www.ruby-forum.com/t/generate-a-page-and-save-as-html/176297>\
**Category:** Rails\
**Created:** [September 28, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/generate-a-page-and-save-as-html/176297 "2009-09-28T19:49:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 28, 2009, 7:49pm UTC](https://www.ruby-forum.com/t/generate-a-page-and-save-as-html/176297/1 "2009-09-28T19:49:31Z")

</div>

Is there a way to generate content, and then save the resulting HTML  
(including application layout, etc) ?

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 28, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/generate-a-page-and-save-as-html/176297/2 "2009-09-28T19:52:31Z")

</div>

Aldric G. wrote:

> Is there a way to generate content, and then save the resulting HTML  
> (including application layout, etc) ?

Well, you could use page caching. 🙂

If you need more flexibility, try render\_to\_string.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 28, 2009, 8:43pm UTC](https://www.ruby-forum.com/t/generate-a-page-and-save-as-html/176297/3 "2009-09-28T20:43:26Z")

</div>

Marnen Laibow-Koser wrote:

> Aldric G. wrote:
> 
> > Is there a way to generate content, and then save the resulting HTML  
> > (including application layout, etc) ?
> 
> Well, you could use page caching. 🙂
> 
> If you need more flexibility, try render\_to\_string.

I will play with that; thanks.
