提交 99975e74 编写于 作者: D David Heinemeier Hansson

Variants can be declared without a block to signify their presence in the controller

上级 a16fa9ab
......@@ -466,7 +466,9 @@ def initialize(variant)
end
def method_missing(name)
yield if name == @variant || (name == :none && @variant.nil?)
if block_given?
yield if name == @variant || (name == :none && @variant.nil?)
end
end
end
end
......
......@@ -170,7 +170,7 @@ def variant_plus_none_for_format
respond_to do |format|
format.html do |variant|
variant.phone { render text: "phone" }
variant.none { render text: "none" }
variant.none
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册