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
Post a Comment