我正在使用带有导轨的余烬.我想在rails资产管道中获取图像路径.emberjs在sass-rails中是否有像asset-path这样的功能?
我学习emberjs形成trek.github.com.该教程使用了Em.ObjectController和Em.ArrayController.而且还有Em.Controller.
我很困惑何时使用它们,我猜Em.ObjectController是单个对象,Em.ArrayController是数组,Em.Controller只是为ApplicationController.
什么时候使用哪个有什么有福的规则?
我想I18n.t在资产管道js.coffee.erb文件中使用帮助器.
我的本地文件:
zh-CN:
hello: ??
Run Code Online (Sandbox Code Playgroud)
在hello.js.coffee.erb:
$->
alert '<%= t(:hello) %>'
Run Code Online (Sandbox Code Playgroud)
这将导致"Encoding::InvalidByteSequenceError - "\xE5" on US-ASCII"错误.
资产管道文件是否支持使用I18n.t帮助程序?
错误日志:
Encoding::InvalidByteSequenceError - "\xE5" on US-ASCII
(in /.../hello.js.coffee.erb):
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:123:in `escape'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:69:in `escape'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:177:in `encode_json'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:220:in `block in encode_json'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:220:in `encode_json'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:48:in `block in encode'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:77:in `check_for_circular_references'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:46:in `encode'
(gem) activesupport-3.2.12/lib/active_support/json/encoding.rb:31:in `encode'
(gem) activesupport-3.2.12/lib/active_support/core_ext/object/to_json.rb:16:in `to_json'
(gem) multi_json-1.6.1/lib/multi_json/adapters/json_common.rb:10:in `dump'
(gem) multi_json-1.6.1/lib/multi_json.rb:122:in `dump'
(gem) execjs-1.4.0/lib/execjs/json.rb:11:in `encode'
(gem) execjs-1.4.0/lib/execjs/external_runtime.rb:33:in …Run Code Online (Sandbox Code Playgroud) 我正在将我的rails视图移植到emberjs.似乎有模板分离的视图和出口帮助器.由于插座用于状态更改,我计划使用视图助手模仿导轨部分.我对吗?