module FormObjects::Nesting

Public Instance Methods

define_nested_writer_method(method_name) click to toggle source
# File lib/form_objects/nesting.rb, line 9
def define_nested_writer_method(method_name)
  alias_method :"#{method_name}_attributes=", :"#{method_name}="
end
nested_form(attribute, form, options = {}) click to toggle source
# File lib/form_objects/nesting.rb, line 3
def nested_form(attribute, form, options = {})
  attribute(attribute, form, options)
  validates_associated(attribute)
  define_nested_writer_method(attribute)
end