0

ファイルピッカーを使用して画像をレールアプリにアップロードしています。次に、ショーページに、画像を開いて鳥小屋内で編集できるボタンがあります。

エディターは開きますが、表示された直後に閉じます。コンソールのエラーは次のとおりです。

リソースはスクリプトとして解釈されますが、MIME タイプ text/html で転送されます:

現在のコードは次のとおりです。

<%= javascript_tag do %>
        //Setup Filepicker.io - to get an apikey, go to https://developers.filepicker.io/register/
        filepicker.setKey('Ao6qJVzzAQ5K8zL6UUhxKz');

        //Setup Aviary
        var featherEditor = new Aviary.Feather({
            //Get an api key for Aviary at http://www.aviary.com/web-key
            apiKey: 'jdbk5iwjxibpotfn',
            apiVersion: 2,
            onSave: function(imageID, newURL) {
                //Export the photo to the cloud using Filepicker.io!
                filepicker.export(newURL, {extension:'.png'});
            },
            appendTo: 'web_demo_pane'
        });

        //Giving a placeholder image while Aviary loads
        var preview = document.getElementById('web_demo_preview');
        var editPane = document.getElementById('start_web_demo');
        editPane.onclick = function(){
        //When the user clicks the button, import a file using Filepicker.io
        var theurl = "<%= @user.filepicker_url %>+.jpg";
        preview.src = theurl;
                featherEditor.launch({
                    image: preview,
                    url: theurl
                });
    };

    <% end %>
4

2 に答える 2

0

ここで別の変更を行い、現在は機能しています.保存されたファイルがサムネイルのバージョンを変更しないことを受け入れます???

//filepicker.store(newURL);
$.post(oldurl, {url: newURL}, function(response){console.log(response);});

filepicker.io ファイルのすべてのバージョンが変更されないのはなぜですか?

于 2013-05-29T19:24:46.293 に答える
0
This line needed to change 

<%= @user.filepicker_url %>+.jpg

To this: 

<%= @user.filepicker_url %>
于 2013-05-29T19:02:41.737 に答える