insideというサブフォルダーへの変更と移動は既に除外mercury.js
しました。application.js
require_tree .
require_directory .
mercury.js
mercury
assets/javascripts
したがって、私のアプリの他のすべてはうまく機能しており、水銀をまったくロードしていません.
今layouts/mercury.html.erb
<%= stylesheet_link_tag 'mercury/mercury' %>
<%= javascript_include_tag 'jquery-1.7', 'mercury/mercury' %>
と
<script type="text/javascript">
// Set to the url that you want to save any given page to, leave null for default handling.
var saveUrl = null;
// Instantiate the PageEditor
new Mercury.PageEditor(saveUrl, {
saveStyle: 'form', // 'form', or 'json' (default json)
saveMethod: null, // 'PUT', or 'POST', (create, vs. update -- default PUT)
visible: true // boolean - if the interface should start visible or not
});
</script>
しかし、エディターが読み込まれると、次のエラーが発生します。
TypeError: 'undefined' is not a constructor (evaluating 'new Mercury.PageEditor')
サブフォルダに何かありますか?