Get current url

Hi friends,

i need current url in rails environment file.

i can get current url in conroller by the below command.

request.env[‘HTTP_HOST’]

and now i want get current url in environment.rb file or intializer
folder
files

Regards,
Daya.

On 7 October 2013 15:49, Daynthan K. [email protected] wrote:

Hi friends,

i need current url in rails environment file.

i can get current url in conroller by the below command.

request.env[‘HTTP_HOST’]

and now i want get current url in environment.rb file or intializer folder
files

environment.rb and initialisers are run when the server is started,
there is no current url at that time as the first request may not have
been made yet.

Colin

hi friends

first thanks for your immediate reply.

i am using omnicontacts for import friends concepts. so i created google
api key that redirect uri is

http://example.com/contacts/gmail/callback

if i enter http://example.com that time i got correct reply

if i enter http://www.example.com that time i got redirect uri is miss
match(google error)

so i create two api keys one for http://example.com another one for
http://www.example.com.

if i get current url in omnicontacts.rb i will give a correct rediect
path
using in conditional statment.

On Oct 7, 2013, at 8:49 AM, Daynthan K. [email protected]
wrote:

and now i want get current url in environment.rb file or intializer folder files

There is no “current url” at initialization time. What are you trying to
do?


Scott R.
[email protected]
http://www.elevated-dev.com/
(303) 722-0567 voice