Rails 3: How to render ERb template in rake task?

前端 未结 4 1592
无人及你
无人及你 2020-12-25 15:17

I am rendering a pretty huge sitemap HTML file with rake. Unfortunately, the code breaks when I migrate to rails 3. My current code looks like this:

@control         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-25 15:24

    This is what worked for me:

    html = render_to_string(:index, layout: nil)
    

提交回复
热议问题