Permalink
Browse files

Merge pull request #12740 from gaurish/patch-1

Improve Errors when Controller Name or Action isn't specfied
  • Loading branch information...
2 parents 98cff28 + 834eb80 commit 4a344c50a1a7a7f544f96c71d613fbb959c5b777 @rafaelfranca rafaelfranca committed Nov 11, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -226,11 +226,13 @@ def default_controller_and_action
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/

0 comments on commit 4a344c5

Please sign in to comment.