Module: UrlHelper

Defined in:
lib/frontman/helpers/url_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_url(url) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/frontman/helpers/url_helper.rb', line 4

def format_url(url)
  formatted = url.gsub('index.html', '')
                 .sub(%r{^/}, '')
                 .chomp('/')

  "/#{formatted}/".gsub('//', '/')
end