HAML prevents template engines to render anything else than HTML

后端 未结 1 969
既然无缘
既然无缘 2021-01-12 18:09

I am using Jbuilder (and I also tried to use Rabl) to render json. When I try to render the jbuilder template in my application it renders the template within the la

相关标签:
1条回答
  • 2021-01-12 19:09

    Gosh, it took me about two days to find out that the issue that is causing this problem is my layouts/application file which was named aplication.haml.

    Now when I wanted to use a template engine like Builder for xml or Rabl for json, it tried to render the template within the yield field in the layouts/application.haml file and thus returning html as JSON

    I found out that the problem lies within the application.haml file

    naming it application.html.haml solved the problem...

    0 讨论(0)
提交回复
热议问题