问题描述
不知何故,我觉得像这样命名视图是可能的:
Somehow I was under the impression that naming views like this was possible:
show.js.custom.coffee
假设我的两个处理程序都正常工作,并且 show.js.custom
和 show.js.coffee
都工作正常,但是当我将两个扩展放在一起时,Rails反对(为简洁起见编辑):
Suppose I have both handlers working properly, and both show.js.custom
and show.js.coffee
work fine, but when I put both extensions together, Rails balks with (edited for brevity):
缺少模板显示 {:handlers=>[:custom, :coffee], :formats=>[:js]}...
所以,如果这一切可能的话,我需要做什么才能让它发挥作用?
So if this is at all possible, what is it I need to do to make it work?
谢谢!
推荐答案
您还可以通过使用此 博客文章 我写的.正如布鲁斯特所建议的那样,针对不同类型对其进行操作.
You can also use haml in js.coffee templates by using the code from this blog post I wrote. And manipulate it for different types, just as brewster suggests.
这篇关于在 Rails 3 中链接模板处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!