diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-11-10 17:32:56 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-11-10 17:32:56 -0800 |
commit | 4a344c50a1a7a7f544f96c71d613fbb959c5b777 (patch) | |
tree | 12243cfb32e230aaf67f7b5f3d2afecd1fab3a50 /actionpack | |
parent | 98cff28d3f7811ac970e06191a2f7892d2f57155 (diff) | |
parent | 834eb80b597eb07addc5ed706b23f31a9bb37954 (diff) | |
download | rails-4a344c50a1a7a7f544f96c71d613fbb959c5b777.tar.gz rails-4a344c50a1a7a7f544f96c71d613fbb959c5b777.tar.bz2 rails-4a344c50a1a7a7f544f96c71d613fbb959c5b777.zip |
Merge pull request #12740 from gaurish/patch-1
Improve Errors when Controller Name or Action isn't specfied
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index db9c993590..cd5220548c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -226,11 +226,13 @@ module ActionDispatch action = action.to_s unless action.is_a?(Regexp) if controller.blank? && segment_keys.exclude?(:controller) - raise ArgumentError, "missing :controller" + message = "Missing :controller key on routes definition, please check your routes." + raise ArgumentError, message end if action.blank? && segment_keys.exclude?(:action) - raise ArgumentError, "missing :action" + message = "Missing :action key on routes definition, please check your routes." + raise ArgumentError, message end if controller.is_a?(String) && controller !~ /\A[a-z_0-9\/]*\z/ |