lib/padrino-routing.rb in padrino-routing-0.1.2 vs lib/padrino-routing.rb in padrino-routing-0.1.3

- old
+ new

@@ -34,13 +34,13 @@ # Hijacking route method in sinatra to replace a route alias (i.e :account) with the full url string mapping # Supports namespaces by accessing the instance variable and appending this to the route alias name # If the path is not a symbol, nothing is changed and the original route method is invoked def route(verb, path, options={}, &block) - if path.kind_of?(Symbol) + if path.kind_of?(Symbol) route_name = [@_namespace, path].flatten.compact if mapped_url = options.delete(:map) # constructing named route - map(*route_name).to(mapped_url) + map(*route_name).to(mapped_url) path = mapped_url else # referencing prior named route route_name.unshift(self.app_name) path = named_paths[route_name] end