파일 선택기를 사용하여 이미지를 내 레일 앱에 업로드 한 다음 표시 페이지에 이미지를 열어서 새 사물함 내부에서 편집 할 수있는 버튼이 있습니다.Aviary가 열린 직후 닫습니다.
편집기가 열리지 만 잠시 표시된 후에 닫힙니다. 그것은 지금처럼 여기
코드입니다 : 여기에 좋아<%= 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 %>
위로 링크 - http://stackoverflow.com/questions/11988437/im-getting-the-message-resource-interpreted-as-script-but-transferred-with-mime – David
감사합니다. 그게 도움이되었습니다. 문제를 이해하십시오. –