Sep 14, 2009

Merb - a bug for merb router

You can not include a number(0-9) in your controller's name if you use it with nested routes. e.g.
namespace :ordering do |order|
order.resources :codebook2s do |cb2|
cb2.resources :codebook2_line_items
end
...
...
end
view raw router.rb hosted with ❤ by GitHub

Here is the quick fix:
# merb-core-1.0.9/lib/merb-core/dispatch/router/route.rb
- SEGMENT_REGEXP_WITH_BRACKETS = /(:[a-z_]+)(\[(\d+)\])?/
+ SEGMENT_REGEXP_WITH_BRACKETS = /(:[a-z0-9_]+)(\[(\d+)\])?/
view raw route.rb hosted with ❤ by GitHub