Skip to content

Instantly share code, notes, and snippets.

@jakcharlton
Created May 23, 2011 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakcharlton/986173 to your computer and use it in GitHub Desktop.
Save jakcharlton/986173 to your computer and use it in GitHub Desktop.
How to turn to CoffeeScript
$(document).ready(function() {
$('.edit_area').editable('/fragments/1/save', {
loadurl : '/fragments/1/load_markup',
type : 'textarea',
cancel : 'Cancel',
submit : 'OK',
onblur : 'submit',
indicator : '<img src="/assets/rails.png">',
tooltip : 'Click to edit...'
});
});
@TrevorBurnham
Copy link

Sorry for the delay in responding. How about:

$(document).ready ->
  $('.edit_area').editable '/fragments/1/save', {
    loadurl   : '/fragments/1/load_markup'
    type      : 'textarea'
    cancel    : 'Cancel'
    submit    : 'OK'
    onblur    : 'submit'
    indicator : '<img src="/assets/rails.png">'
    tooltip   : 'Click to edit...'
  }

@jakcharlton
Copy link
Author

Thanks - did the job .... now a Rails + CoffeeScript problem arises, the .erb doesn't have access to url_for LOL ... gonna be a fun learnign process I can see! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment