如何获取真实路径和别名路径
在我的 Rails 应用程序中,我在 apache httpd.conf 添加了一个别名路径,如下所示:
alias /ckfinder /var/www/html/ckfinder
但是,我如何获取模型中“/ckfinder”的真实路径?谢谢。
In my rails app,I have add a alias path at apache httpd.conf like this:
alias /ckfinder /var/www/html/ckfinder
but ,how i can get the real path of '/ckfinder' in model? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为除了读取 apache 配置文件并自己解释它之外,rails 没有任何方法可以了解 apache 别名。
请记住,rails 也可以通过其他 Web 服务器运行。
为什么不能将 ckfinder 安装在 Rails 应用程序的“公共”目录中,以便始终可以相对于应用程序找到它?
I don't believe there's any way for rails to know about apache aliases other than by reading an apache config file and interpreting it yourself.
Remember, rails can be run through other web servers too.
Why can't you just have ckfinder installed in the "public" directory of your rails app so it can always be found relative to the app?