method
apply_form_for_options!
v7.0.0 -
Show latest stable
- Class:
ActionView::Helpers::FormHelper
apply_form_for_options!(object, options)private
No documentation available.
# File actionview/lib/action_view/helpers/form_helper.rb, line 463
def apply_form_for_options!(object, options) # :nodoc:
object = convert_to_model(object)
as = options[:as]
namespace = options[:namespace]
action = object.respond_to?(:persisted?) && object.persisted? ? :edit : :new
options[:html] ||= {}
options[:html].reverse_merge!(
class: as ? "#{action}_#{as}" : dom_class(object, action),
id: (as ? [namespace, action, as] : [namespace, dom_id(object, action)]).compact.join("_").presence,
)
end