Rails: Render view from outside controller

前端 未结 8 2182
不思量自难忘°
不思量自难忘° 2020-12-15 03:41

I\'m trying to create an HTML string using a view. I would like to render this from a class that is not a controller. How can I use the rails rendering engine outside a co

8条回答
  •  被撕碎了的回忆
    2020-12-15 04:23

    For future reference, I ended up finding this handy gem that makes this a breeze:

    https://github.com/yappbox/render_anywhere

提交回复
热议问题