I am trying to password protect the fonts sub-directory in my assets directory because of licensing etc. I have tried a few ideas for routing, but I haven't been able to figure one out yet.
As of now, if you use the route assets/* you can access the file, however I am trying to make it go to an http_basic_auth. I have tried setting up a controller called asset_controller with the http_basic_auth in it, but I can't seem to get the routing correct. Here is my code so far:
routes.rb (this obviously does not work...)
match '/assets/', to: 'assets#show'
asset_controller.rb
class AssetController < ApplicationController
http_basic_authenticate_with :name => "admin", :password => "secret"
end
Also, this approach may be wrong. So, if there is a better solution please suggest one!