在某些情况下,我会在上下文中运行我的应用程序,例如:/context/app,但有时我只使用:/app
在我的数据库中,我有一个应用程序表,该表具有应用程序路径的属性(例如/app),我想要的是,我的应用程序可以确定在哪个上下文中运行,以便更新该属性(例如/context/app)
我认为这是一件令人讨厌的事情,但我不知道如何才能向他索取这些信息。
上下文是通过乘客使用RailsBaseURI设置的。
在某些情况下,我会在上下文中运行我的应用程序,例如:/context/app,但有时我只使用:/app
在我的数据库中,我有一个应用程序表,该表具有应用程序路径的属性(例如/app),我想要的是,我的应用程序可以确定在哪个上下文中运行,以便更新该属性(例如/context/app)
我认为这是一件令人讨厌的事情,但我不知道如何才能向他索取这些信息。
上下文是通过乘客使用RailsBaseURI设置的。
做
RAILS_ROOT
给你你需要的?它应该返回应用程序的根。
如果这不是你想要的,那么我认为需要更多关于你试图做什么的信息。
collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...
We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...
As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...
I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?
I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...
I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml
guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...
I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...