Does anyone know the best approach to create local-only path?
====code begin====
MyApp::Application.routes.draw do
match 'quicksearch' => 'application#quicksearch'
end
===code end===
I want the path '\quicksearch' to be exactly local (available from application itself only), any external requests must be ignored.
The first thing came into my mind is to create small request filter based on IP (?). Of course...
Filter can be route-level or middleware-level, but anywhere.. IP address as a base of distinction seems to me not so good.
Oops, I just realized that javascript code executing always on client’s browser, and any request will have ‘REMOTE_ADDR’ = client’s IP. Thus, there is only approach to use some kind of authenticity_token.