Class: Interview::NestedFormRemoveLink

Inherits:
Control
  • Object
show all
Defined in:
lib/interview/controls/nested_form_remove_link.rb

Instance Attribute Summary

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods inherited from Control

#ancestors, #build_child, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults

Constructor Details

This class inherits a constructor from Interview::Control

Instance Method Details

#build(b) ⇒ Object



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

def build(b)
  assoc_object = find_attribute! :assoc_object
  assoc_method = find_attribute!(:assoc_method).to_s
  text = h.t('views.nested_form_remove', association: assoc_object.class.human_attribute_name(assoc_method.singularize)) # todo: in view auslagern
  b.link caption: text, url: '#', class: 'nested_form_remove_link'
end