padrino/padrino-framework — pull request #955 by kylewlacy (2012-11-16 03:48:33+00:00)
Title: Partial Implementation of Relative Routes

Since I've come across Padrino, the main issue I've come across is named routes leading to redundant `map` requests. I saw issue #747, and decided to see what it would take to implement this right now. I know it's slated for release for milestone 0.11.0, but I did it now anyway (seeing as 0.10.8 missed the slated release by 3 months already). I know the tests fail, so I know this probably won't be merged now, especially before 0.10.8.

Here's an example use that shows some of the possible uses:

```ruby
# app/controllers/users.rb
MyApp.controllers :users do
get :sign_up, '/sign_up' do
'sign up'
end

get :sign_in, '/sign_in' do
'sign in'
end

get :list, :index do
'listing all users'
end

get :show, ':id' do
"showing user with id #{params[:id]}"
end
end
```

# $ padrino rake routes
=> Executing Rake routes ...

Application: MyApp
URL REQUEST PATH
(:users, :sign, :up) GET /sign_up
(:users, :sign, :in) GET /sign_in
(:users, :list) GET /users
(:users, :show) GET /users/:id