2012-02-24 21:36:44 +01:00
|
|
|
- if note.valid?
|
|
|
|
:plain
|
2012-08-30 20:31:55 +02:00
|
|
|
$(".note-form-holder .error").remove();
|
|
|
|
$('.note-form-holder textarea').val("");
|
|
|
|
$('.note-form-holder #preview-link').text('Preview');
|
|
|
|
$('.note-form-holder #preview-note').hide();
|
|
|
|
$('.note-form-holder').show();
|
2012-08-11 00:07:50 +02:00
|
|
|
NoteList.prepend(#{note.id}, "#{escape_javascript(render partial: "notes/show", locals: {note: note})}");
|
2012-02-24 21:36:44 +01:00
|
|
|
- else
|
|
|
|
:plain
|
2012-08-30 20:31:55 +02:00
|
|
|
$(".note-form-holder").replaceWith("#{escape_javascript(render('form'))}");
|
2012-02-24 21:36:44 +01:00
|
|
|
|