Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.91 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <title>CodeMirror: Theme Demo</title>
  4. <meta charset="utf-8"/>
  5.  
  6.  
  7. <%= stylesheet_link_tag "/assets/codemirror.css", :media => "all" %>
  8. <%= stylesheet_link_tag "/assets/monokai.css", :media => "all" %>
  9. <%= javascript_include_tag "/assets/javascript.js" %>
  10.  
  11.  
  12.  
  13. <style type="text/css">
  14.       .CodeMirror {border: 1px solid black; font-size:13px; height: 600px;}
  15.     </style>
  16.  
  17.  
  18. <article>
  19. <% # /editor/test?file_src=app/views/editor/test.html.erb %>
  20. <%= @file_src %>
  21. <%= form_tag({:controller => "editor/test", :action => "save"}, :method => "post") %>
  22. <%= text_area(:code, :code, size: '100x5', :value => "#{File.read(@file_src)}") %>
  23. <%= submit_tag "save" %>
  24.  
  25.  
  26. <h2>save file contents</h2>
  27.  
  28. <%= @save %>
  29.  
  30.  
  31. <script>
  32.   var editor = CodeMirror.fromTextArea(document.getElementById("code_code"), {
  33.     theme: "monokai",
  34.     lineNumbers: true,
  35.     tabSize: 80
  36.   });
  37.  
  38. </script>
  39.   </article>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement