I have the following Coffeescript:
$ -> $('#new_event').submit -> $.post( $(this).attr('action') $(this).serialize() (data, textStatus, jqXHR) -> $('#target').html(data) ) return false
And it translates as follows:
$(function() { return $('#new_event').submit(function() { $.post($(this).attr('action'), $(this).serialize(), function(data, textStatus, jqXHR) { return $('#target').html(data); }); return false; }); });
So far so good. However, how to add another line to submit? For instance:
$ -> $('#new_event').submit -> test = $(this).serialize() $.post( $(this).attr('action') $(this).serialize() (data, textStatus, jqXHR) -> $('#target').html(data) ) return false
This gives an unexpected INDENT error. I canβt understand what Iβm missing here ...
Thanks, Dani.
source share