Module: ActionDispatch::Routing::UrlFor

Defined in:
lib/controller/url_for_context_path.rb

Instance Method Summary collapse

Instance Method Details

#url_for(options = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/controller/url_for_context_path.rb', line 6

def url_for(options = nil)
  url = url_for_original(options)
 
  # Will remove a context path from a relative url. The issue happens when an 
  # webs platform application has a non-root context path.  By removing the context path from the 
  # url url_for and named paths will now work
  url = url[(Webs::PLATFORM_CONTEXT_PATH.length)..url.length-1] if defined?(Webs::PLATFORM_CONTEXT_PATH) && url.index( Webs::PLATFORM_CONTEXT_PATH )==0
 
  url
end

#url_for_originalObject



4
# File 'lib/controller/url_for_context_path.rb', line 4

alias_method :url_for_original, :url_for