Method: Padrino::Routing::InstanceMethods#current_path

Defined in:
padrino-core/lib/padrino-core/application/routing.rb

#current_path(*path_params) ⇒ Object

Returns the current path within a route from specified path_params.



833
834
835
836
837
838
839
840
841
842
# File 'padrino-core/lib/padrino-core/application/routing.rb', line 833

def current_path(*path_params)
  if path_params.last.is_a?(Hash)
    path_params[-1] = params.merge(path_params[-1])
  else
    path_params << params
  end

  path_params[-1] = Utils.symbolize_keys(path_params[-1])
  @route.path(*path_params)
end