开发者

It is possible for my Rails App knows under which context of HTTP is running?

开发者 https://www.devze.com 2023-01-20 04:59 出处:网络
In certain situations I run my app in a context like: /context/app , but sometimes I only use: /app In my DB I have an applications table that has an attribute for the path of the application (ex. /

In certain situations I run my app in a context like: /context/app , but sometimes I only use: /app

In my DB I have an applications table that has an attribute for the path of the application (ex. /app ), what I'm looking is that my app could determine in which context is running in order to update that attribute开发者_StackOverflow社区 (ex. /context/app)

I think is a rack thing but I don't know how can I ask him for that information.

The context is set through passenger using RailsBaseURI.


Does

RAILS_ROOT

give you what you need? It should return the root of the application.

If this isn't what you are after then I think more information is needed about what you are trying to do.

0

精彩评论

暂无评论...
验证码 换一张
取 消