codeguy/Slim — Issue #184: Wildcard in the route
Author: semencov
Created: 2011-10-12 07:36:03+00:00
State: open

Is there any option to set the wildcard to the route or to the part of it?

While inspired by Nesta CMS which is based on Sinatra, I didn't find such feature in your framework (did I miss something?).

In Nesta it is used to catch all URLs ant to retrieve specific template file.

```ruby
get '*' do
set_common_variables
@heading = @title
parts = params[:splat].map { |p| p.sub(/\/$/, '') }
@page = Nesta::Page.find_by_path(File.join(parts))
raise Sinatra::NotFound if @page.nil?
@title = @page.title
set_from_page(:description, :keywords)
cache haml(@page.template, :layout => @page.layout)
end
```

The difference is that in your framework it parse URL parameters by word (\w), so you can not make some common rule with unknown amount of parameters or words.

I like your framework a lot, so could we see something similar?