This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
README
current_request - maurĂcio DOT linhares AT gmail DOT com
====
This plugin sets the current Rails request object in a Thread local variable
so you can use it in places where the controller (and thus the request) are not
directly available.
The most common case for this are the e-mail templates, where sometimes you need
to render a link but you don't have access to the current request to add the
host. With this plugin you'll have the request at the e-mail templates and
will be able to find out the current host to add a link to it:
<%= link_to 'Home', "#{current_request.protocol}#{current_request.host_with_port}/home" %>
Or you can just use a shorthand to the current host:
<%= link_to 'Home', "#{current_host}/home" %>
You can also use it wherever you want to access the current request
(and not only on templates) by calling:
CurrentRequest::Holder.current_request
You can install the plugin by calling:
ruby script/plugin install git://github.com/mauricio/current_request.git







