title: How to render js template from module included in controller?
body: <p>I have an action in a controller concern, which gets included in a controller. This action does not render a js.erb file as specified under a respond_to block. <strong>How do I properly get an action in a controller concern to successfully render a js.erb file (or any view, for that matter)?</strong> Is it a problem with my routes?</p>
  
  <p><strong>The link for the module action</strong></p>
  
  <pre><code>= link_to image_tag("upvote.png"), 
  send("vote_socionics_#{votable_name}_path", votable, vote_type: "#{s.type_two_im_raw}"),           
  id: "vote-#{s.type_two_im_raw}",           
  method: :post,          
  remote: true
  </code></pre>
  
  <p>** The link for the controller action**</p>
  
  <pre><code>= link_to "whatever", characters_whatever_path, remote: true
  </code></pre>
  
  <p><strong>controllers/characters_controller.rb</strong></p>
  
  <pre><code>class CharactersController &lt; ApplicationController
    include SocionicsVotesConcern
  
    def an_action
      respond_to do |format|
        format.js { render 'shared/vote_socionics' }   # This renders/executes the file
      end
    end
  </code></pre>
  
  <p><strong>controllers/concerns/socionics_votes_concern.rb</strong></p>
  
  <pre><code>module SocionicsVotesConcern
    extend ActiveSupport::Concern
  
    def vote_socionics
      respond_to do |format|
        format.js { render 'shared/vote_socionics' }   # This DOES NOT render/execute the file. Why?
      end
    end
  
  end
  </code></pre>
  
  <p><strong>views/shared/whatever.js.erb</strong></p>
  
  <pre><code>  # js code that executes 
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>  concern :socionics_votes do
      member do
        post 'vote_socionics'
      end
    end
  
    resources :universes
    resources :characters,  concerns: :socionics_votes
    resources :celebrities, concerns: :socionics_votes
    resources :users,       concerns: :socionics_votes
  </code></pre>