title: How to render the index view, from inside a view in ruby-on-rails
body: <p>I'm trying to render a the index view inside my ruby-on-rails application. How do a I render the index view, from inside a view passing an array of things to display? Using the link_to.</p>
  
  <p>I do not want to re-route to the controller, I just want to link_to a view passing it the variables it needs, how can I do this? 
  EDIT: 
  I am trying to create a page type functionality in the index of my article model. So I have around 400 articles for example, and when the index action in the article controller is called, it of course renders the index view which is calling a partial for each article in the '@articles array' passed on by article controller's index action. </p>
  
  <p>So in the view, I'm trying to do something like:</p>
  
  <pre><code>    &lt;% count = 0 %&gt;
      &lt;% @articles.each do |article| %&gt;
        &lt;% if count &lt;10 %&gt;
          &lt;%= render partial: 'index_articles', locals: {article: article} %&gt;
          &lt;% count = count + 1 %&gt;
        &lt;% end %&gt;
      &lt;% end %&gt;
      &lt;% @articles = @articles.drop(10) %&gt;
      &lt;% if @articles.any? %&gt;
        &lt;%= link_to "Next", 'articles', locals: {@articles =&gt; @articles} %&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>Thank you in advanced for all of your help.</p>