Rails; save a rendered views html content to file

前端 未结 2 1266
花落未央
花落未央 2020-12-28 20:55

I\'m trying to create a view with a download link to download the html source?

2条回答
  •  滥情空心
    2020-12-28 21:12

    You can use render_to_string instead of render, which will give you the page, then to download it use send_data.

    More on render to string here, and more on send_data here.

提交回复
热议问题