title: Setting hint text in a text field in Ruby on Rails
body: <p>Can some one suggest the best way for setting hint text(not default text) for a text field  in Ruby on Rails. Currently I am using this:</p>
  
  <pre><code>&lt;%= text_field_with_auto_complete
    "customer", 
    :contact_person, { 
      :value =&gt; 'last, first',
      :style =&gt; 'color:#aaa;width:11em;', 
      :onfocus =&gt; "if(this.getValue()=='last, first'){this.clear();this.style.color = '#000';}",
      :onblur =&gt; "if(this.getValue()==''){this.setValue('last, first');this.style.color = #aaa';}" 
    } %&gt;
  </code></pre>
  
  <p></p>
  
  <p>The text field is attached to a model and in turn to a value in a database. Also, the same html that is used in index.html is also used in edit.html and hence when I try to edit the field, the default value shows up instead of the value from the database. What is the correct way to do this? </p>
  
  <p>Note: I am not trying to set a default value but just a hint to what needs to be entered in the text box.</p>
  
  <p>Thanks,</p>
  
  <p>Raja Ram</p>