咖啡豆宝石无法正常工作
这是我的控制器:
class ScriptController < ApplicationController
respond_to :js
def show
puts 'here'
@client_id = params[:id]
respond_with @client_id
end
end
我有一个在 app/views/script/show.js.coffee
中调用的文件,但当我转到显示页面时它不会加载。我正在使用 Coffeebeans gem: 通过视图加载 .coffee 文件Rails
有什么帮助吗?
编辑:添加错误
模板丢失
缺少模板 good_comments/script/show、good_comments/application/show 以及 {:handlers=>[:erb, :builder], :formats=>[:js , :html], :locale=>[:en, :en]}。搜索位置:*“/Users/shamoon/Sites/good_comments/spec/dummy/app/views”*“/Users/shamoon/Sites/good_comments/app/views”
So here's my controller:
class ScriptController < ApplicationController
respond_to :js
def show
puts 'here'
@client_id = params[:id]
respond_with @client_id
end
end
I have a file called in app/views/script/show.js.coffee
but it doesn't load when I go to the show page. I'm using the coffeebeans gem: Loading .coffee files via a view in Rails
Any help?
EDIT: Added Error
Template is missing
Missing template good_comments/script/show, good_comments/application/show with {:handlers=>[:erb, :builder], :formats=>[:js, :html], :locale=>[:en, :en]}. Searched in: * "/Users/shamoon/Sites/good_comments/spec/dummy/app/views" * "/Users/shamoon/Sites/good_comments/app/views"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要使用 CoffeeBeans,
coffee-rails
会直接处理 Coffeescript 的渲染。我像这样渲染咖啡脚本:
Don't use CoffeeBeans,
coffee-rails
handles rendering of coffeescript out-of-box.I render coffeescripts like this: