我可以在render.js上执行的视图中使用CoffeeScript吗? [英] Can I use CoffeeScript in the views executed on render.js?

查看:173
本文介绍了我可以在render.js上执行的视图中使用CoffeeScript吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做什么,以便我可以在Rails JS视图中使用CoffeeScript?例如:

What do I need to do so that I can use CoffeeScript in the Rails JS views? For example:

def index
    format.js { render :layout => false } 
end

我需要做什么才能让Rails使用 index.js.coffee

What would I need to do in order for Rails to use index.js.coffee?

推荐答案

3.1。您需要使用 Coffeebeans

It's not yet supported in 3.1. You will need to use Coffeebeans.

更新:现在支持在rails 3.2中

这篇关于我可以在render.js上执行的视图中使用CoffeeScript吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆