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| %>
<%= f.label :content %> - <%= f.text_area :content, class: 'form-control' %> + <%= f.text_area :content, class: 'form-control', rows: 15 %>
<%= f.submit 'Paste it!', class: 'btn btn-primary' %> <% end %> diff --git a/app/views/pastes/show.html.erb b/app/views/pastes/show.html.erb index bd35c5c..c9f47c5 100644 --- a/app/views/pastes/show.html.erb +++ b/app/views/pastes/show.html.erb @@ -1 +1 @@ -
<%= @paste.content %>
+
<%= @paste.content %>