我使用过这个宝石:https://github.com/SammyLin/redactor-rails
的application.js
//= require redactor-rails
//= require redactor-rails/video
本地主机
<script src="/assets/redactor-rails/redactor.js?body=1"></script>
<script src="/assets/redactor-rails/config.js?body=1"></script>
<script src="/assets/redactor-rails/index.js?body=1"></script>
<script src="/assets/redactor-rails/video.js?body=1"></script>
其中redactor-rails / video.js是Redactor网站的视频插件manually downloaded。
主编-导轨/ config.js
$(document).ready(
function(){
var csrf_token = $('meta[name=csrf-token]').attr('content');
var csrf_param = $('meta[name=csrf-param]').attr('content');
var params;
if (csrf_param !== undefined && csrf_token !== undefined) {
params = csrf_param + "=" + encodeURIComponent(csrf_token);
}
$('.redactor').redactor(
{ "imageUpload":"/redactor_rails/pictures?" + params,
"imageGetJson":"/redactor_rails/pictures",
"fileUpload":"/redactor_rails/documents?" + params,
"fileGetJson":"/redactor_rails/documents",
"path":"/assets/redactor-rails", //<--- Maybe is this?
"css":"style.css",
"plugins": ['video']}
);
});
我的localhost上的一切正常,但它不在远程服务器上。我认为可能是由Asset Pipeline引起的。 在远程服务器控制台上,它不显示任何错误消息。
答案 0 :(得分:0)
<强>分辨强>
<强>的application.js 强>
//= require redactor-rails/redactor
//= require redactor-rails/video
//= require redactor-rails/config