title: How to implement dynamic content render when form submited (newbie ask)
body: <p>I am developing rails 3 application (I am newbie in Rails). </p>
  
  <p>Currently, I have a form (use "<code>form_for</code>") for submit, there is a <code>div</code> area under the form. What I want is when user click the '<strong>submit</strong>' button of the form, based on the user input data in the form, application will first go to the database to retrieve and organize some data, then the <code>div</code> area under the form will be rendered with the organized data. </p>
  
  <p>That's the content of the <code>div</code> area is rendered <strong>dynamically</strong> based on user's input in the form, and the <code>div</code> render happens when user click "<strong>submit</strong>" form button .</p>
  
  <p>The <code>index.html.haml</code>:</p>
  
  <pre><code>=form_for :myform do |form|
    = ...
    = ...
    =form.submit "submit"
  
  %div.result
    /dynamic content to be rendered here, when user submit the form
    =render :partial 'result'
  </code></pre>
  
  <p>I think my form submission should first go to run a controller method to organize the data from Database, and what's the next step I should do? As you noticed from the above code, I have a partial there under <code>div</code>, I would like to update the '<strong>result</strong>' partial when user submit form, but how to implement this??</p>