Skip to content

Instantly share code, notes, and snippets.

@Fivell
Created December 28, 2016 09:38
Show Gist options
  • Save Fivell/0f1b81f63b1fc789477a3e5383f3df9a to your computer and use it in GitHub Desktop.
Save Fivell/0f1b81f63b1fc789477a3e5383f3df9a to your computer and use it in GitHub Desktop.
form_block
form_block = proc do |has_many_form|
form_block_contents = "".html_safe
index = parent_child_index options[:parent] if options[:parent]
form_block_contents << (block.call(has_many_form, index) || "".html_safe)
form_block_actions = has_many_actions(has_many_form, builder_options, "".html_safe)
form_block_contents << form_block_actions
template.concat(form_block_actions)
form_block_contents
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment