0

ruby on rails サイトで Aviary API を使用しようとしています。onSave 関数で Aviary によって作成された URL を取得するのに問題があります。Rubyでアクセスする方法がわかりません。アイデアはありますか?ruby に入れたい変数はnewURL です

    <% if @photo.image? %>

    <!-- Load widget code -->
<script language="JavaScript" type="text/javascript" src="https://dme0ih8comzn4.cloudfront.net/js/feather.js"></script>


<!-- Instantiate the widget -->
<script type="text/javascript">

    var featherEditor = new Aviary.Feather({
        apiKey: '  f20374413e3ff5a8',
        apiVersion: 2,
        theme: 'light',
        tools: 'all',
        appendTo: '',
        fileFormat: 'jpg',
        onSave: function(imageID, newURL) {
            var img = document.getElementById(imageID);
            img.src = newURL;
        },
    });

    function launchEditor(id, src) {
        featherEditor.launch({
            image: id,
            url: src
        });
       return false;
    }

</script>                         

<!-- Add an edit button, passing the HTML id of the image and the public URL to the image -->
<a href="#" data-refresh="true" onclick="return launchEditor('editimage1', 
    '<%= @photo.image.url %>');">Edit!</a>

<img id='editimage1' src='<%= @photo.image.url %>' height="352" width="470"/>


  <% end %>
4

0 に答える 0