0

I'm curious how Padrino accomplishes mapping:

get :index do

to:

get '/' do

I'm having trouble finding it in the source.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Jesse Earle
  • 1,622
  • 1
  • 11
  • 13

1 Answers1

1

It simply overrides the get method, i.e.:

alias old_get get

def get(path)
  if path == :index
    old_get '/'
  else
    old_get path
  end
end
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Hauleth
  • 22,873
  • 4
  • 61
  • 112