Skip to content

Instantly share code, notes, and snippets.

@13k
Created September 24, 2009 19:58
Show Gist options
  • Select an option

  • Save 13k/193004 to your computer and use it in GitHub Desktop.

Select an option

Save 13k/193004 to your computer and use it in GitHub Desktop.
def Object.method_added(method)
return super(method) unless method == :helper
helper.instance_variable_set("@controller", app)
def helper.method_missing(method, *args, &block)
helper.send(method, *args, &block) if helper.instance_variable_get('@controller') && method.to_s =~ /_path$|_url$/
end
end if ENV['RAILS_ENV']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment