diff app/views/tweets/index.html.erb @ 116:32c8c150cd80

100% less javascripts
author nanaya <me@myconan.net>
date Sun, 12 Feb 2017 16:59:32 +0900
parents 394235fd42d2
children e3067b426b70
line wrap: on
line diff
--- a/app/views/tweets/index.html.erb	Sun Feb 12 16:46:26 2017 +0900
+++ b/app/views/tweets/index.html.erb	Sun Feb 12 16:59:32 2017 +0900
@@ -62,7 +62,13 @@
     </p>
 
     <form class="js-twitter--form twitter-form">
-      <input type="text" placeholder="Enter Username" class="js-twitter--input twitter-form__input" autofocus>
+      <input
+        name="id"
+        type="text"
+        placeholder="Enter Username"
+        class="js-twitter--input twitter-form__input"
+        autofocus
+      >
       <button type="submit">
         Go
       </button>
@@ -72,15 +78,4 @@
     <hr>
     <a href="https://bitbucket.org/nanaya1/rsstweet">Source</a>
   </div>
-
-  <script>
-    var form = document.getElementsByClassName('js-twitter--form')[0]
-    var input = document.getElementsByClassName('js-twitter--input')[0]
-    var doRedirect = function(e) {
-      e.preventDefault()
-      document.location = "/" + input.value
-    }
-
-    form.addEventListener('submit', doRedirect)
-  </script>
 </body>