Skip to content

Commit

Permalink
Merge pull request #4633 from chumakoff/fix_template_variable_assign
Browse files Browse the repository at this point in the history
Change the way of assigning template variables
  • Loading branch information
varyonic committed Jan 23, 2017
2 parents a81cd03 + 64f6099 commit c946408
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit c946408

Please sign in to comment.