title: Best Practice for views to nested resources in Rails?
body: <p>I have a fairly simple model; Users have_many products.  I would like to be able to view a list of all products as well as a list of the products associated with a given user.  My routes are set up like this:</p>
  
  <pre><code>/products
  /products/:id
  /users
  /users/:id
  /users/:id/products
  </code></pre>
  
  <p>The catch here is that I'd like to display the product list differently in the <em>product#index</em> view and the <em>user/products#index</em> view.</p>
  
  <p>Is there a 'correct' way to do this?  My current solution is to define products as a nested resource inside users, and then to check for params[:user_id] - if its found I render a template called 'index_from_user', otherwise I just render the typical 'index' template.</p>
  
  <p>This is a situation I'm running into a lot - if there's a preferred way to do it I'd love to know...</p>