How to save a rendered view as a static file?

后端 未结 2 770
太阳男子
太阳男子 2021-01-31 11:43

My Rails 2.3 app generates a page in HTML/CSS or as a word doc. I\'d like to save that html file to the filesystem as a static file (ie. filename.html or filename.doc). I plan t

2条回答
  •  自闭症患者
    2021-01-31 12:33

    Another way is adding an after_action to the controller, and in that action using response.body to access rendered content. In this way, your controller can respond to client as normal, save rendered content to database in meanwhile.

提交回复
热议问题