class SimpleForm::FormBuilder

def lookup_model_names #:nodoc:

:nodoc:

["route", "blocks", "blocks_learning_object", "foo"]
route[blocks_attributes][0][blocks_learning_object_attributes][1][foo_attributes]

Example:

explicit child indexes.
Extract the model names from the object_name mess, ignoring numeric and
def lookup_model_names #:nodoc:
  @lookup_model_names ||= begin
    child_index = options[:child_index]
    names = object_name.to_s.scan(/(?!\d)\w+/).flatten
    names.delete(child_index) if child_index
    names.each { |name| name.gsub!('_attributes', '') }
    names.freeze
  end
end