How render to file

Hi

I have a question
when you open page from browser
application renders the page and gives it to the browser
how do that in action and save render page in html file

Thanks!

done.

example how do that.

after_filter :write_file

def index
end

protected

def write_file
File.open(‘public/test.html’, ‘w+’) do |f|
f.write response.body
end
end