diff --git a/app/assets/javascripts/pastes.js.coffee b/app/assets/javascripts/pastes.js.coffee index b40f467..cf33fea 100644 --- a/app/assets/javascripts/pastes.js.coffee +++ b/app/assets/javascripts/pastes.js.coffee @@ -1,6 +1,6 @@ # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ -$(document).ready -> - $("pre code").each (i, e) -> +$(document).on 'ready page:load', -> + $(".highlight pre code").each (i, e) -> hljs.highlightBlock e diff --git a/app/views/pastes/_form.html.erb b/app/views/pastes/_form.html.erb index 51d6578..fd7cde4 100644 --- a/app/views/pastes/_form.html.erb +++ b/app/views/pastes/_form.html.erb @@ -1,7 +1,7 @@ <%= form_for @paste do |f| %>
<%= @paste.content %>
+<%= @paste.content %>