Rails - How can a controller differentiate an internal GET request form a user GET request
<p>I have this route:</p>

<pre><code>get 'taglist', to: 'search#taglist_prefetch'
</code></pre>

<p>and this controller action:</p>

<pre><code>def taglist_prefetch
  render json: Item.tag_counts
end
</code></pre>

<p>The URL <code>/taglist</code> is used by twitter typeahead for the prefetch. I don't want users to be able to navigate to <code>/taglist</code> and see the JSON output. How can I differentiate the get request coming from the app vs a user so I can make a <code>before_filter</code> in the controller?</p>