Render a page as a saved HTML file using Rails 3.0? -


i'm building simple website generator application in rails 3.0. i'd "publish" action in controller works ordinary "show" action, instead, saves page html file in "public" directory instead of displaying in browser. is, i'd use rails render mechanism create file instead of providing http response.

what's best way this?

should add caches_page :publish controller?

or use render_to_string , file.new?

you can use render_to_string method: http://apidock.com/rails/abstractcontroller/rendering/render_to_string

you still need respond controller though. maybe redirect page saved?


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -