Module: Nesta::Plugin::Sluggable

Defined in:
lib/nesta-plugin-sluggable/init.rb,
lib/nesta-plugin-sluggable/version.rb

Defined Under Namespace

Modules: Helpers

Constant Summary collapse

SLUGGED_FORMAT =
/^\d+$/
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.resolve_path(path) ⇒ Object



10
11
12
13
14
15
# File 'lib/nesta-plugin-sluggable/init.rb', line 10

def self.resolve_path(path)
  segments = path.split('/')
  path = segments[0..-2].join('/') if segments[-2].to_s.match(SLUGGED_FORMAT)

  path
end