Sha256: 6ac4bf67506c4d280467dc2bbf8a7f9c766b0aed1cc39ed6abcc079d6d235a58
Contents?: true
Size: 885 Bytes
Versions: 942
Compression:
Stored size: 885 Bytes
Contents
<h1>New Post</h1> <p><input type='text' id='title' name='title' placeholder='Title' style="width: 400px;" /></p> <div id='message'></div> <p><input type='submit' value='Add Post' onclick='add_post();' /></p> <% content_for :caboose_js do %> <%= javascript_include_tag "caboose/model/all" %> <script type='text/javascript'> var modal = false; $(document).ready(function() { modal = new CabooseModal(420); }); function add_post() { modal.autosize("<p class='loading'>Adding post...</p>"); $.ajax({ url: '/admin/posts', type: 'post', data: { authenticity_token: "<%= form_authenticity_token %>", title: $('#title').val(), }, success: function(resp) { if (resp.error) modal.autosize("<p class='note error'>" + resp.error + "</p>"); if (resp.redirect) window.location = resp.redirect } }); } </script> <% end %>
Version data entries
942 entries across 942 versions & 1 rubygems