title: Re-render a page using jquery
body: <p>In react, I could easily re-render a view by passing results from controller. I wish not to use React at this stage and was wondering if it's possible with JQuery?</p>
  
  <p>I have few objects on page, and when clicked, I should see its content. Click the other object, I see its content etc. Sense? I was inspired by <a href="https://dribbble.com/shots/3047167-Timesheet" rel="nofollow noreferrer">this dribbble</a>.</p>
  
  <p>I may not be doing this the right way but this is what I have:</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>def index
    selected_contract = params[:selected_contract] || current_user.contracts.last.id
    @contracts = current_user.contracts.order(created_at: :desc).all
    @selected_contract = current_user.contracts.find_by(id: selected_contract)
  end
  </code></pre>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;% @contracts.each do |contract| %&gt;
    &lt;button class="ui button test" id="&lt;%=contract.id%&gt;"&gt;&lt;%=contract.name%&gt;&lt;/button&gt;
  &lt;% end %&gt;
  
  ......................................
  When clicked, show its content
  ....................................
  
  &lt;%= @selected_contract.name %&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>$( ".ui.button.test" ).click(function(e) {
    let { id } = this
    console.log(id)
    $.ajax({
      url: `/url/${id}`,
      type: 'POST',
      success: function(result) {
        //$('#listview').redraw()
        console.log('success')
      }
    });
  });
  </code></pre>
  
  <p>Routes are set properly so I get the params in the controller just fine. Is there a re-render a view, just like rerender a prop in React for jquery? Am I doing this the correct way?</p>