svenfuchs / routing-filter

routing-filter wraps around the complex beast that the Rails routing system is, allowing for unseen flexibility and power in Rails URL recognition and generation.
http://www.artweb-design.de
MIT License
464 stars 84 forks source link

Not working with Rails 3 #4

Closed grosser closed 14 years ago

grosser commented 14 years ago

/home/micha/.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-3.0.0.beta3/lib/active_support/dependencies.rb:440:in `load_missing_constant': ActionDispatch::Routing is not missing constant Mapper! (ArgumentError)

can be fixed with:

klass = if ActionPack::VERSION::MAJOR >= 3
  ActionDispatch::Routing::DeprecatedMapper
else
  ActionController::Routing::RouteSet::Mapper
end

# allows to install a filter to the route set by calling: map.filter 'locale'
klass.class_eval do

next errors are strangerer.... good luck with them :D

hukl commented 14 years ago

the locale use case can be directly addressed with rails 3 without using routing-filter. so if thats what you're after don't use routing-filter in rails3 and use the "native" :scope instead

grosser commented 14 years ago

resources :categories, :scope => 'cms' does not work, it still produces /categories, not /cms/categories, we build a rack middleware to do the trick for now, but using routing_filter would be nicer :) http://github.com/grosser/rack-path_prefixer

svenfuchs commented 14 years ago

routing_filter should now work with rails 3. unfortunately the changes aren't backwards compatible. so people using rails 2.x need to stick to the 0.0.x tags (installing it as a plugin). the 0.1.x gems are targeted at rails 3 ... not that widely used/tested in the wild yet :)

closing this ...