title: Generating the edit path for a nested resource referenced by multiple models
body: <p>In routes.rb:</p>
  
  <pre><code>resources :cars do
    resources :reviews
  end
  
  resources :motorcycles do
    resources :reviews
  end
  </code></pre>
  
  <p>In ReviewsController:</p>
  
  <pre><code>before_filter :find_parent
  
  def show
    @review = Review.find(params[:id])
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml =&gt; @review }
    end
  end
  
  def edit
    @review = Review.find(params[:id])
  end
  
  # ...
  def find_parent
    @parent = nil
    if params[:car_id]
      @parent = Car.find(params[:car_id])
    elsif params[:motorcycle_id]
      @parent = Motorcycle.find(params[:motorcycle_id])
    end
  end
  </code></pre>
  
  <p>Generating the "show" link for a Review is simply (this works):</p>
  
  <pre><code>= link_to "Show", [@parent, @review]
  </code></pre>
  
  <p>Similarly I would like to reference a generic edit path for a Review, something like (this does not work):</p>
  
  <pre><code>= link_to "Edit", [@parent, @review], :action =&gt; 'edit'
  </code></pre>
  
  <p>Does anyone know if this is possible or, if not, how this might be accomplished?</p>