Preview this post

<%= form_tag "/blog_admin/#{@post.id}/#{lock_toggle_target}", :method => :post do %> <% end %>

<%= form_tag "/blog_admin/#{@post.id}", :method => :put do %>

" <%= lock_disabled %> /> /> />

URL Title: <%= @post.url_title %>

Title: />

Author: />

Tweet: <% if @post.tweeted_at %> (sent <%= @post.tweeted_at.strftime "%-m/%-d/%Y %-l:%M %P" %>) <% end %>

/>

Content:

/>

<% end %>
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" %> <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js" %> <%= stylesheet_link_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css" %> <%= javascript_tag do %> $(function() { $("input[name='posted_at_date']").datepicker({ dateFormat: "yy-mm-dd" }); $(".preview-content").click(function() { var $this = $(this).attr("disabled", "disabled"); $.ajax({ url: "/blog_admin/preview_content", type: "post", data: { authenticity_token: $("form input[name='authenticity_token']").val(), content: $("textarea[name='content']").val() }, dataType: "text", success: function(text) { $(".preview-content").html(text); $this.removeAttr("disabled"); }, error: function() { $(".preview-content").html('
There was an error.
'); $this.removeAttr("disabled"); } }); return false; }); }); <% end %>