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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJySvxfocH15Z_WON1aqW_11%2BohiAzXSpBVe1FcgsGmt1eA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On 7 October 2013 15:49, Daynthan Kabilan <dayanthan86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 > filesenvironment.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> > Regards, > Daya. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJySvxfocH15Z_WON1aqW_11%2BohiAzXSpBVe1FcgsGmt1eA%40mail.gmail.com. > For more options, visit https://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv7OO1y0mc4exyVP6fTYqRdiFip3-4KQkVY8vxLXuRHzg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
On Oct 7, 2013, at 8:49 AM, Daynthan Kabilan <dayanthan86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> and now i want get current url in environment.rb file or intializer folder filesThere is no "current url" at initialization time. What are you trying to do? -- Scott Ribe scott_ribe-ZCQMRMivIIdUL8GK/JU1Wg@public.gmane.org http://www.elevated-dev.com/ (303) 722-0567 voice -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7CBE5B31-E727-41B8-8607-D7BF33DEC41A%40elevated-dev.com. For more options, visit https://groups.google.com/groups/opt_out.
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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyQX2QRFn%3DtZsNWK3dxNxa1Q0ohy8UCu%3DqDkUfh%3DXW%3Dghg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.