title: Ruby on rails forms: How to put text into an input field that disappears on click
body: <p>I want to create a form that does not have a label, and instead puts the directions inside the actual input text field. I also want the directions to disappear when you click the text field. </p>
  
  <p>Here is an example 
  <a href="http://www.dailyblogtips.com/wp-content/uploads/searchform.png" rel="nofollow">http://www.dailyblogtips.com/wp-content/uploads/searchform.png</a></p>
  
  <p>I know in html, you do something like this </p>
  
  <pre><code>&lt;input type="text" name="s" id="s" value="Text to be displayed here" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/&gt;
  </code></pre>
  
  <p>But how can I accomplish this using rails form helpers.</p>
  
  <p>Here is what I have so far</p>
  
  <pre><code>  &lt;div class="row"&gt;
      &lt;div class="small-12 columns"&gt;
        &lt;div class="panel"&gt;
          &lt;%= form_for(@message) do |f| %&gt;
              &lt;%= f.label :body, "Description" %&gt;
              &lt;%= f.text_area :body %&gt;
              &lt;%= f.submit 'Create message', class: 'button small secondary' %&gt;
          &lt;% end %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>