app/helpers/association_helper.rb
# rendering button to delete(remove) assoc_target entity in association
rendering button to delete(remove) assoc_target entity in association
rendering button to delete ( remove ) assoc_target entity in association
def button_to_delete_assoc_target(name, assoc_target, assoc_name, options=nil, html_options = {})
    registered? or return ""  
    options ||= {}
    single = options[:single] ? 'yes' : 'no'
    base_div_id = options[:base_div_id]
    assoc_body_elem = "this.up('.#{assoc_name}')"
    function_to_remove = if assoc_target.blank? || assoc_target.new_record? 
        "this.up('.assoc_target').remove();"
      else
        "#{assoc_body_elem}.previous('.deletion_mark_field').value=#{@current_user.run_id};" +  
        "#{assoc_body_elem}.remove();"
      end + 
      "n_of_assoc_target = recount_assoc_target_counters('#{base_div_id}',  '#{single}');"  
    button_to_function name, function_to_remove, html_options
  end
def button_to_delete_assoc_target ( name , assoc_target , assoc_name , options = nil , html_options = { } ) registered? or return "" options ||= { } single = options [ :single ] ? 'yes' : 'no' base_div_id = options [ :base_div_id ] assoc_body_elem = "this.up('.#{assoc_name}')" function_to_remove = if assoc_target . blank? || assoc_target . new_record? "this.up('.assoc_target').remove();" else "#{assoc_body_elem}.previous('.deletion_mark_field').value=#{@current_user.run_id};" + "#{assoc_body_elem}.remove();" end + "n_of_assoc_target = recount_assoc_target_counters('#{base_div_id}',  '#{single}');" button_to_function name , function_to_remove , html_options end
rendering button to delete(remove) assoc_target entity in association
rendering button to delete ( remove ) assoc_target entity in association
# illegal access # new_record; remove whole assoc target elem # existing record # mark disconnection # recount assoc_target counters
name
<not_specific>
assoc_target
<not_specific>
assoc_name
<not_specific>
options
<not_specific>
html_options
<not_specific>