Monday, October 7, 2013

Re: [Rails] Get current url

On 7 October 2013 15:49, Daynthan Kabilan <dayanthan86@gmail.com> 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

>
> 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@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> 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@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate