title: Rails - display results of index and show actions via ajax
body: <p>I have a very simple Post resource with two actions, <em>index and show</em>. My template contains a sidebar with links to each previous post. I want the sidebar links to display their content (i.e. <em>the results of the "show" action</em>) via ajax</p>
  
  <p>I know there are lots of <a href="http://www.alfajango.com/blog/rails-3-remote-links-and-forms/" rel="noreferrer">excellent</a> <a href="http://stjhimy.com/posts/7-creating-a-100-ajax-crud-using-rails-3-and-unobtrusive-javascript" rel="noreferrer">tuts</a> that show you how to create a form that submits with ajax but this time I want to use it to display the contents of my index and show actions without page referesh</p>
  
  <p>. Are there any decent tutorials out there that give tips on how to do this?</p>
  
  <p>I reckon I need to create a <strong>show.js.erb</strong> file, and tell my index action to respond to js but I'm a little bit stuck getting any further. I don't quite know what to put in controller's show action or show.js.erb - it's a little difficult to visualise what I need to do</p>
  
  <p>PS - using rails 3.0.7, jquery-1.5</p>