0
我正在开发一个Ruby On Rails应用程序,我正在调用公共/资产的一些js,css,图像和csv文件。如何在Ruby On Rails中阻止访问公共/资源url
class MyPageController < ApplicationController
before_action :authenticate
def index
end
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == 'login' && password == 'password'
end
end
end
,它适用于这个页面,但如果我型我localhost:3000/assets/myFile.csv
可以访问并下载它没有被要求进行身份验证:
使用这些资产的访问网页时我增加了一个身份验证。
有没有办法在该网址添加身份验证或阻止它?
感谢