title: Render three different partials depending on button clicked
body: <p>So I have a layout like this:</p>
  
  <p>home/index.html.erb:</p>
  
  <pre><code>&lt;div class="optionscontainer btn-group btn-group-justified"&gt;
     &lt;%= link_to posts_path, class:"options btn btn-primary", remote: true do %&gt;
        &lt;i class="fa fa-book optionseach" aria-hidden="true"&gt;&lt;/i&gt;All posts
     &lt;% end %&gt;
     &lt;%= link_to stories_path, class:"options btn btn-primary", remote: true do %&gt;
        &lt;i class="fa fa-book optionseach" aria-hidden="true"&gt;&lt;/i&gt;All stories
     &lt;% end %&gt;
  &lt;/div&gt;
     &lt;div id="content" class=""&gt;
     &lt;/div&gt;
  </code></pre>
  
  <p>In posts_controller.rb</p>
  
  <p>I have:</p>
  
  <pre><code>def index
      @posts = Post.all
      respond_to do |format|
        format.html #looks for views/books/index.html.erb
        format.js   #looks for views/books/index.js.erb
      end
    end
  </code></pre>
  
  <p>In stories_controller.rb</p>
  
  <p>I have:</p>
  
  <pre><code>def index
      @stories = Story.all
      respond_to do |format|
        format.html #looks for views/books/index.html.erb
        format.js   #looks for views/books/index.js.erb
      end
    end
  </code></pre>
  
  <p>In my views/posts/index.js.erb</p>
  
  <pre><code>$("#content").html("&lt;%= j (render 'posts') %&gt;");
  </code></pre>
  
  <p>In my views/stories/index.js.erb</p>
  
  <pre><code>$("#content").html("&lt;%= j (render 'stories') %&gt;");
  </code></pre>
  
  <p>And I also have <code>_posts.html.erb</code> in <code>views/posts</code> and <code>_stories_html.erb</code> in <code>views/stories</code></p>
  
  <p>What happens is when i click on the posts button i renders the view but when i click on the stories button nothing renders?</p>