SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 252 forks source link

upload documents #91

Open viktorsheshenya opened 11 years ago

viktorsheshenya commented 11 years ago

When loading documents pdf error: Uncaught TypeError: Cannot read property '0' of null

my config: $(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, "fileUpload":"/redactor_rails/documents?" + params, "imageGetJson":"/redactor_rails/pictures", "path":"/assets/redactor-rails", "css":"style.css"} ); });

my uploadres: class RedactorRailsDocumentUploader < CarrierWave::Uploader::Base include RedactorRails::Backend::CarrierWave

storage :fog

storage :file

def store_dir "system/redactor_assets/documents/#{model.id}" end

def extension_white_list RedactorRails.document_file_types end end

Help.

ilyadoroshin commented 11 years ago

same here :(