1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test
schneems 0b6175ac2d Add Missing Keys from Journey on failed URL format
Many named routes have keys that are required to successfully resolve. If a key is left off like this:

    <%= link_to 'user', user_path %>

This will produce an error like this:

    No route matches {:action=>"show", :controller=>"users"}

Since we know that the :id is missing, we can add extra debugging information to the error message.

    No route matches {:action=>"show", :controller=>"users"} missing required keys: [:id]


This will help new and seasoned developers look closer at their parameters. I've also subclassed the routing error to be clear that this error is a result of attempting to generate a url and not because the user is trying to visit a bad url. 

While this may sound trivial this error message is misleading and confuses most developers. The important part isn't what's in the options its's what's missing. Adding this information to the error message will make debugging much more obvious. 

This is the sister pull request of https://github.com/rails/journey/pull/44 which will be required to get they missing keys into the correct error message. 

Example Development Error in Rails: http://cl.ly/image/3S0T0n1T3421
2012-08-28 08:53:45 -07:00
..
abstract add lazy look up in abstract controller's translate method 2012-07-18 10:33:14 +03:00
activerecord Extract ActiveRecord::SessionStore from Rails 2012-08-24 15:24:19 -04:00
assertions test response assertions 2012-01-06 11:20:26 -08:00
controller Add Missing Keys from Journey on failed URL format 2012-08-28 08:53:45 -07:00
dispatch Add Missing Keys from Journey on failed URL format 2012-08-28 08:53:45 -07:00
fixtures Indentation should consider line number character count. 2012-08-13 18:49:47 -03:00
lib/controller Add HTML5 input[type="color"] helper 2012-05-21 17:23:48 -03:00
metal ActionController::Caching depends on RackDelegation and AbstractController::Callbacks 2012-06-13 16:18:03 -03:00
routing add some tests, yay! 2012-02-22 11:05:03 -08:00
template Fix ActionView::RecordIdentifier to work as a singleton 2012-08-28 11:19:37 +02:00
tmp
abstract_unit.rb Extract common controllers to abstract_unit 2012-08-13 21:43:18 -03:00
active_record_unit.rb
ts_isolated.rb Don't use assert_block method. It will be deprecated. 2012-05-20 00:14:40 +09:00