HAML prevents template engines to render anything else than HTML

為{幸葍}努か 提交于 2019-12-01 04:24:43

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...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!