Skip to content

Instantly share code, notes, and snippets.

@rsl
Forked from wmoxam/gist:88296
Created May 26, 2009 15:45
Show Gist options
  • Save rsl/118125 to your computer and use it in GitHub Desktop.
Save rsl/118125 to your computer and use it in GitHub Desktop.
class ControllerHelper
include Singleton
include ActionView::Helpers
end
def url_helpers
ControllerHelper.instance
end
Then in any controller you want to use a url helper, ex:
flash[:success] = "Go here: #{url_helpers.link_to 'foo', foo_path}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment