lib/scaffolding_extensions/helper.rb
# Line item with button for removing the associated record from the current record
Line item with button for removing the associated record from the current record
Line item with button for removing the associated record from the current record
def scaffold_habtm_association_line_item(klass, association, record, associated_record)
        name = klass.scaffold_name
        associated_suffix = klass.scaffold_associated_name(association)
        arid = associated_record.scaffold_id
        rid = record.scaffold_id
        content = "<li id='#{name}_#{rid}_#{association}_#{arid}'>\n"
        content << scaffold_check_link(klass.scaffold_associated_human_name(association), false, "manage_#{associated_suffix}")
        content << " - \n"
        content << scaffold_check_link(associated_record.scaffold_name, false, "edit_#{associated_suffix}", :id=>arid)
        content << "\n"
        content << scaffold_button_to_remote('Remove', "remove_#{association}_from_#{name}", :id=>rid, "#{name}_#{association}_id"=>arid)
        content << "\n</li>\n"
        content
      end
def scaffold_habtm_association_line_item ( klass , association , record , associated_record ) name = klass . scaffold_name associated_suffix = klass . scaffold_associated_name ( association ) arid = associated_record . scaffold_id rid = record . scaffold_id content = "<li id='#{name}_#{rid}_#{association}_#{arid}'>\n" content << scaffold_check_link ( klass . scaffold_associated_human_name ( association ) , false , "manage_#{associated_suffix}" ) content << " - \n" content << scaffold_check_link ( associated_record . scaffold_name , false , "edit_#{associated_suffix}" , :id => arid ) content << "\n" content << scaffold_button_to_remote ( 'Remove' , "remove_#{association}_from_#{name}" , :id => rid , "#{name}_#{association}_id" => arid ) content << "\n</li>\n" content end
Line item with button for removing the associated record from the current record
Line item with button for removing the associated record from the current record
klass
association
record
associated_record