提交 4a344c50 编写于 作者: R Rafael Mendonça França

Merge pull request #12740 from gaurish/patch-1

Improve Errors when Controller Name or Action isn't specfied
......@@ -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/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册