Method: Jets::Router::Scope#full_prefix
- Defined in:
- lib/jets/router/scope.rb
#full_prefix ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/jets/router/scope.rb', line 31 def full_prefix items = walk_parents do |current, i, result| prefix = current.[:prefix] next unless prefix case current.from when :resources variable = prefix.to_s.split('/').last variable = ":#{variable.singularize}_id" result.unshift(variable) result.unshift(prefix) else # resource, namespace or general scope result.unshift(prefix) end end items.empty? ? nil : items.join('/') end |