提交 4147ab73 编写于 作者: G Gaurav Sharma

proper raise ArgumentError, divided large text new line

上级 367e8cf7
......@@ -10,7 +10,7 @@ module UrlFor
include ActionDispatch::Routing::UrlFor
def _routes
raise "In order to use #url_for, you must include routing helpers explicitly. " \
raise "In order to use #url_for, you must include routing helpers explicitly.\n" \
"For instance, `include Rails.application.routes.url_helpers`."
end
......
......@@ -81,9 +81,9 @@ def variant=(variant)
if variant.all? { |v| v.is_a?(Symbol) }
@variant = ActiveSupport::ArrayInquirer.new(variant)
else
raise ArgumentError, "request.variant must be set to a Symbol or an Array of Symbols. " \
"For security reasons, never directly set the variant to a user-provided value, " \
"like params[:variant].to_sym. Check user-provided value against a whitelist first, " \
raise ArgumentError, "request.variant must be set to a Symbol or an Array of Symbols.\n" \
"For security reasons, never directly set the variant to a user-provided value,\n" \
"like params[:variant].to_sym. Check user-provided value against a whitelist first,\n" \
"then set the variant: request.variant = :tablet if params[:variant] == 'tablet'"
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册