= content_for :page_javascript do :javascript function rowAdd(){ $.get("#{url_for(action: :add_row,new_record: @mynumber.new_record?)}", function(data){ $("#family_table.rows").append($(data)); datePickerInput("#family_table.rows"); } ); }; function removeFields(link){ var row = $(link).closest("div.row"); row.remove(); }; function formChange(){ $.get("#{url_for(action: :change_form)}", {key_1: $("#mynumber_key_1").val()}, function(data){ $("#new_form").replaceWith($(data)); datePickerInput("#new_form"); } ); }