francesc/rails-translate-routes — Issue #11: Matching regex results in
Author: guiocavalcanti
Created: 2012-02-07 16:56:48+00:00
State: open

I defined my routes as follows:

```ruby
Redu::Application.routes.draw do
namespace 'api' do
match '*anything', :to => 'api#routing_error'
end
end
ActionDispatch::Routing::Translator.translate_from_file('lang/i18n-routes.yml')
```

When I try to run ``rake routes`` I get this error:

```
(in /Users/guiocavalcanti/workspace/work/redu)
** Invoke routes (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
can't convert Array into String
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rack-mount-0.6.14/lib/rack/mount/regexp_with_named_groups.rb:31:in `initialize'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rack-mount-0.6.14/lib/rack/mount/regexp_with_named_groups.rb:31:in `compile'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rack-mount-0.6.14/lib/rack/mount/regexp_with_named_groups.rb:31:in `initialize'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rack-mount-0.6.14/lib/rack/mount/regexp_with_named_groups.rb:25:in `new'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rack-mount-0.6.14/lib/rack/mount/regexp_with_named_groups.rb:25:in `new'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route.rb:25:in `initialize'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:186:in `inject'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route.rb:24:in `each'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route.rb:24:in `inject'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route.rb:24:in `initialize'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:299:in `new'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/actionpack-3.0.10/lib/action_dispatch/routing/route_set.rb:299:in `add_route'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rails-translate-routes-0.0.4/lib/rails-translate-routes.rb:195:in `translate'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rails-translate-routes-0.0.4/lib/rails-translate-routes.rb:194:in `each'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rails-translate-routes-0.0.4/lib/rails-translate-routes.rb:194:in `translate'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rails-translate-routes-0.0.4/lib/rails-translate-routes.rb:193:in `each'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rails-translate-routes-0.0.4/lib/rails-translate-routes.rb:193:in `translate'
/Users/guiocavalcanti/.rvm/gems/ruby-1.8.7-p352/gems/rails-translate-routes-0.0.4/lib/rails-translate-routes.rb:347:in `translate_from_file'
/Users/guiocavalcanti/workspace/work/redu/config/routes.rb:6
```

I'm trying to make a catch all route (inside api namespace) to rescue from RoutingError (see [this](http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution) reference for detils).