title: Rails polymorph relation with a controller for the associated model
body: <p>I'm trying to complete my app but I'm blocked in front of a relation.</p>
  
  <p>I have 3 models: Video, Gallery and Content.</p>
  
  <p>Every model is sharable and i have a content_share model. So, for example, I have</p>
  
  <pre><code>class Video &lt; ActiveRecord::Base
    include Sharable
  end
  
  module Sharable
    extend ActiveSupport::Concern
    included do
      has_one :content_share, as: :sharable
      accepts_nested_attributes_for :content_share, reject_if: :all_blank
    end
  end
  
  class ContentShare &lt; ActiveRecord::Base
    belongs_to :sharable, polymorphic: true
    mount_uploader :image, ShareUploader
  end
  </code></pre>
  
  <p>I must create a form to create the "content_share".</p>
  
  <p>In my video controller I add:</p>
  
  <pre><code>  def activate
      render 'admin/shared/content_share', locals: { shared: video }
    end 
  </code></pre>
  
  <p>because I want to reuse the form page also for gallery and video.</p>
  
  <p>Now the problem: with my form</p>
  
  <pre><code>= simple_form_for [:admin, shared] do |form|
    = form.fields_for :content_share, shared.build_content_share do |share_form|
  </code></pre>
  
  <p>when I submit my form the action is routed to my video controller. How can I use the content_share controller I created for my model so I avoid the triplication?</p>