jQuery(function() {
  
  jQuery('a[href=#preview]').click(function(e) {
    var form = jQuery('#new_reply');
    jQuery.ajax({
      url: form.attr('action'),
      type: 'post',
      data: {
        reply: {
          content: form.find('#reply_content').val()
        }
      },
      success: function(data) {
        var html = jQuery(data).find('#preview').html();

        jQuery('#preview').html(html);
      }
    });
  });

});

jQuery(function() {

  jQuery('a[href=#preview]').click(function(e) {
    var form = jQuery(this).parents('form');
    jQuery.ajax({
      url: '/previews/new',
      type: 'get',
      data: {
        content: form.find('textarea').val(),
      },
      success: function(data) {
        jQuery('#preview').html(data);
      }
    });
  });

});

Switch to preview rendering in seperate controller
Switch to preview rendering in seperate controller
