title: Resetting the value of fields after submitting the ruby form
body: <p>I have search field based on date entered.</p>
  
  <p>The problem is whenever I am submitting the form then searched results comes good but search string disappears from the field as the page reloaded.</p>
  
  <p>Can anyone tell me how to persist the search string in the field.</p>
  
  <p>I am using ruby form and below is the code..</p>
  
  <pre><code>&lt;%=form_for :messages, url: url_for( :controller =&gt; :time_sheets, :action =&gt; :late ), :html =&gt; { :id =&gt; "submitForm1" } do |f| %&gt;
          &lt;div class="field"&gt;
               &lt;tr&gt;   
                  &lt;td&gt; From Date &lt;%= f.text_field :leaveFrom, :id =&gt; 'datepicker2', :class =&gt; 'phcolor','data-validation' =&gt;'required', :readonly =&gt; true %&gt;&lt;/td&gt;
                  &lt;td&gt; To Date &lt;%= f.text_field :leaveTo, :id =&gt; 'datepicker7', :class =&gt; 'phcolor', :readonly =&gt; true %&gt;&lt;/td&gt;
                  &lt;td &gt;Late Time&lt;%= f.text_field :on_duty, :id =&gt; 'timepicker5' %&gt;&lt;/td&gt;
                  &lt;div class="actions"&gt;
                    &lt;td style="position: absolute;right: 178px;"&gt;&lt;input type="button"  class="btn btn-primary" id="submitid" tabindex="7" value="Go"&gt;&lt;/td&gt;
                  &lt;/div&gt;
              &lt;/tr&gt;
          &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>