Created
October 3, 2010 22:47
-
-
Save dariocravero/609023 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !absolute_map or !@_map.blank? | |
# Add any controller level map to the front of the path | |
path = "#{@_map}/#{path}".squeeze('/') | |
# Small reformats | |
path.gsub!(%r{/?index/?}, '') # Remove index path | |
path[0,0] = "/" unless path =~ %r{^\(?/} # Paths must start with a / | |
path.sub!(%r{/(\))?$}, '\\1') # Remove latest trailing delimiter | |
path.gsub!(/\/(\(\.|$)/, '\\1') # Remove trailing slashes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment