Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way of assigning template variables #4633

Merged
merged 1 commit into from Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/active_admin/form_builder.rb
Expand Up @@ -64,7 +64,7 @@ def has_many(assoc, options = {}, &block)
template.concat has_many_actions(has_many_form, builder_options, "".html_safe)
end

template.assign(has_many_block: true)
template.assigns[:has_many_block] = true
contents = without_wrapper { inputs(options, &form_block) } || "".html_safe

if builder_options[:new_record]
Expand Down
2 changes: 1 addition & 1 deletion lib/active_admin/views/components/active_admin_form.rb
Expand Up @@ -43,7 +43,7 @@ def build(resource, options = {}, &block)

def inputs(*args, &block)
if block_given?
form_builder.template.assign(has_many_block: true)
form_builder.template.assigns[:has_many_block] = true
end
if block_given? && block.arity == 0
wrapped_block = proc do
Expand Down