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

wrong number of arguments (0 for 1) #6

Closed pacoguzman closed 14 years ago

pacoguzman commented 14 years ago

I'm getting this error when using named_routes, this is the error trace:

$HOME/.bundle/ruby/1.8/gems/routing-filter-0.1.6/lib/routing_filter/filter.rb:11:in around_generate' $HOME/.bundle/ruby/1.8/gems/routing-filter-0.1.6/lib/routing_filter/filter.rb:11:insend' $HOME/.bundle/ruby/1.8/gems/routing-filter-0.1.6/lib/routing_filter/filter.rb:11:in run' $HOME/.bundle/ruby/1.8/gems/routing-filter-0.1.6/lib/routing_filter/chain.rb:9:inrun' (eval):3:in export_customers_url' (eval):3:inexport_customers_url'

This is the route.rb file

ActionController::Routing::Routes.draw do |map| map.filter 'locale'

map.resources 'drafts', :path_prefix => 'invoices'

end

Everything was working fine with the version 0.0.5 of routing-filter installed as a plugin. Now I'm running the 0.1.6 gem version

Any advice about the problem?

I'm notice that if I use export_customers_url(:locale => I18n.locale) everything works but I know this isn't the way to deal with it

Thanks

pacoguzman commented 14 years ago

Hi!

Changing the following works for me:

RoutingFilter::Locale def around_generate(params, &block) => def around_generate(params = {}, &block)

Thanks

svenfuchs commented 14 years ago

Pacoguzman, it's not clear to me what Rails version you're using. From what you say I'm guessing you're using Rails 2.3.x?

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 :)

I'm closing this for now ... please reopen the ticket if you're problem refers to Rails 3.

pacoguzman commented 14 years ago

Sven, yep I'm using Rails 2.3.8, so don't worry I fix my installation

Thanks

andresgutgon commented 14 years ago

Hi, i'm trying to use routing-filter with rails 2.3.8 but i can't install 0.0.2 Tag of the plugin:

I'm doing this: script/plugin install git://github.com/svenfuchs/routing-filter.git -r refs/tags/0.0.2

But ouput this: fatal: Couldn't find remote ref refs/tags/0.0.2

Any ideas?

andresgutgon commented 14 years ago

Sorry i missed the "v" in the Tag name. This works for me: script/plugin install git://github.com/svenfuchs/routing-filter.git --revision 'refs/tags/v0.0.2'

svenfuchs commented 14 years ago

Thanks for reporting, Andrés! And sorry for the trouble. I really should add this to the readme.

andresgutgon commented 14 years ago

You're doing a great job, you do not have to apologize :) I am happy to be able to solve.

Thanks to you