Method: Interview::NestedFormAddLink#build

Defined in:
lib/interview/controls/nested_form_add_link.rb

#build(b) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/interview/controls/nested_form_add_link.rb', line 4

def build(b)
  form_builder = find_attribute! :form_builder
  assoc_method = find_attribute!(:assoc_method).to_sym
  text = h.t('views.nested_form_add', association: find_attribute!(:singular_title))
  html = render_form(b, form_builder, assoc_method)
  b.link capion: text, html_options: { href: '#', class: 'nested_form_add_link', data: { content: CGI::escapeHTML(html) } }
end