我有nicEdit的麻烦 .
框架是ruby 2.0.0 / rails 4.0.1
在localhost中,只有在您上传页面两次时才有效 .
但是当在Heroku中部署时,它根本不起作用 .
我跟着this example到达了这条线 .
我在../vendor/assets/javascripts下有一个niEdit.js
这是我的完整形式:
<%= javascript_include_tag 'nicEdit' -%>
<%= simple_form_for(@recipe) do |f| %>
<%= f.error_notification %>
<div class="field">
<%= f.label "Elige un cromo" %>
<%= f.file_field :chrome %>
</div>
<div class="form-inputs">
<%= f.association :user, label_method: :name, collection: User.where(name: current_user.name), :label => "Cociner@" %>
<%= f.association :category, :label => "Categoría", label_method: :plato_category, collection: Category.all %>
<%= f.input :plato %>
<%= f.input :minutos %>
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<div class="well well-small">
<p>Tejemaneje</p>
<%= f.text_area :tejemaneje, :rows => 10, :style => 'width: 700px' %>
</div>
</div>
<p>
</p>
<%= f.button :submit, "Receta", :class => "btn btn-success" %>
<% end %>
我应该做些什么不同才能在localhost和heroku上完全工作?谢谢 .
1 回答
部分解决方案:
我在/ assets / javascript下移动了nicEdit.js并且脚本现在正在运行,但是如果在NicEdit.js里面这行是没关系的
iconsPath:'/assets/nicEditorIcons.gif'和/assets/images/nicEditorIcons.gif下的图标,它们不显示 . /assets/nicEditorIcons.gif也是如此
我移动了/ assets / javascripts下的图标并将行更改为
iconsPath:'... / nicEditorIcons.gif'
我还尝试将图标放在/assets/nicEditorIcons.gif下,并带有图标 . 什么都行不通 .
Heroku有一个特殊的图标位置吗?我是否必须更改脚本调用?有帮助吗?