提交 ecc13f7c 编写于 作者: C Carlos Antonio da Silva 提交者: José Valim

We don't need to check if the format exists to generate the url, it already does it internally

上级 00e76335
......@@ -324,14 +324,13 @@ def apply_form_for_options!(object_or_array, options) #:nodoc:
as = options[:as]
action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :put] : [:new, :post]
html_options = { :class => as ? "#{as}_#{action}" : dom_class(object, action),
:id => as ? "#{as}_#{action}" : dom_id(object, action),
:method => method }
options[:html].reverse_merge!(html_options)
options[:url] ||= options[:format] ?
polymorphic_path(object_or_array, :format => options.delete(:format)) :
polymorphic_path(object_or_array)
options[:html].reverse_merge!(
:class => as ? "#{as}_#{action}" : dom_class(object, action),
:id => as ? "#{as}_#{action}" : dom_id(object, action),
:method => method
)
options[:url] ||= polymorphic_path(object_or_array, :format => options.delete(:format))
end
private :apply_form_for_options!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册