Hi all,
I'm trying to convert what I think are some pretty straight forward Rail2 routes to Rails3 routes with no success.
I have map.connect '', :controller => "agency" which I have tried converting to match '', :to => 'agency' which then throws an error saying:
/home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:183:in `default_controller_and_action': missing :action (ArgumentError) from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:76:in `normalize_options!' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:59:in `initialize' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `new' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1302:in `add_route' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1282:in `decomposed_match' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `each' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/mapper.rb:1268:in `match' from /home/shandy/npower/config/routes.rb:74 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `instance_exec' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:276:in `eval_block' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/actionpack-3.2.2/lib/action_dispatch/routing/route_set.rb:254:in `draw' from /home/shandy/npower/config/routes.rb:1 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:245:in `load' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `each' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:40:in `load_paths' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:16:in `reload!' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:26:in `updater' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `call' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/activesupport-3.2.2/lib/active_support/file_update_checker.rb:78:in `execute' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:27:in `updater' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application/finisher.rb:66 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `run_initializers' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `send' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing' from /home/shandy/npower/config/environment.rb:5 from /home/shandy/npower/config.ru:4:in `require' from /home/shandy/npower/config.ru:4 from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' from /home/shandy/.rvm/gems/ruby-1.8.7-p370/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' from /home/shandy/npower/config.ru:1:in `new' from /home/shandy/npower/config.ru:1
I have also tried
Npower::Application.routes.draw do match 'login', :to => 'agency' end
But then I get an error that says "No route matches [GET] "/agency"." If anybody has any ideas or could point me to a site that explains the differences/conversions of Rails2 routes to Rails3 routes, that would much appreciated. Thanks,
-S