Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Allow for multiple blueprints for the same association #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

singpolyma
Copy link

Fixes #269

@@ -31,7 +31,7 @@ def link_to_add(*args, &block)

options[:class] = [options[:class], "add_nested_fields"].compact.join(" ")
options["data-association"] = association
options["data-blueprint-id"] = fields_blueprint_id = fields_blueprint_id_for(association)
options["data-blueprint-id"] = fields_blueprint_id = fields_blueprint_id_for(options[:blueprint] || association)
args << (options.delete(:href) || "javascript:void(0)")
args << options

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 41 needs to be

block, options = @fields[fields_blueprint_id_for(association)].values_at(:block, :options)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those options not going to be associated with the custom blueprint name when it is set?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Associations with more than one add-link (initialization model)
2 participants