Sha256: 5d8878fae29d4964fd434c897e538016d30cfcfaa95f1e832a7aa0312e39bcdd

Contents?: true

Size: 1.99 KB

Versions: 1

Compression:

Stored size: 1.99 KB

Contents

o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1335834736.269855:@value"‰{I"
class:EFI"ProcessedAsset;FI"logical_path;F"%active_admin/editor/quicksave.jsI"
pathname;F"i/Users/ericholmes/Source/active_admin_editor/app/assets/javascripts/active_admin/editor/quicksave.jsI"content_type;FI"application/javascript;FI"
mtime;FI"2012-04-30T17:57:36-07:00;FI"length;Fi8I"digest;F"%b5b4fa31f041018b0839865a242c91d6I"source;FI"8(function($) {
    $(function(){
        var button = $('.button.quicksave');
        button.click(function(e) {
            e.preventDefault();

            $.ajaxSetup({
                beforeSend: function(xhr) {
                    xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
                }
            });

            var form = $(this).closest('form');
            var url = form.attr('action');
            var textarea = $(this).closest('.active_admin_editor').find('textarea');
            var fields = textarea.attr('id').split('_');
            var content = textarea.val();
            var data = {
                _method: 'PUT'
            };

            data[fields[0]] = {};
            data[fields[0]][fields[1]] = content;

            $.ajax({
                url: url,
                type: 'POST',
                dataType: 'json',
                data: data,
                success: function(response) {
                    console.log('saved');
                }
            });
        });
    });
})(jQuery);
;FI"dependency_digest;F"%7d6b3b025447780ffa7740a293fc839eI"required_paths;F["i/Users/ericholmes/Source/active_admin_editor/app/assets/javascripts/active_admin/editor/quicksave.jsI"dependency_paths;F[{I"	path;F"i/Users/ericholmes/Source/active_admin_editor/app/assets/javascripts/active_admin/editor/quicksave.jsI"
mtime;FI"2012-04-30T17:57:36-07:00;FI"digest;F"%b5b4fa31f041018b0839865a242c91d6I"
_version;F"%aa7d0db7619379e13b08335dee027df2

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_admin_editor-0.1.0 test/dummy/tmp/cache/assets/D86/680/sprockets%2F16dbbba0db91ea56e2a6a5f6450c2522