<commit_before>.title Edit plivo number
=form_for(@plivo_number, url: admin_plivo_path(@plivo_number), remote: true) do |f|
  .section
    %table
      %tbody
        %tr
          %td
            =f.label :number
            =f.text_field :number, disabled: true
        %tr
          %td
            =f.label :label
            =f.text_field :label, required: true
        %tr
          %td
            =f.label :phoneable
            =f.select :phoneable_id, User.all.map{|u| [u.full_name, u.id]}
        %tr
          %td
            =f.submit "Save"
            =link_to "Cancel", admin_plivo_index_path
<commit_msg>radio button for select type<commit_after>.title Edit plivo number
=form_for(@plivo_number, url: admin_plivo_path(@plivo_number), remote: true) do |f|
  .section
    %table
      %tbody
        %tr
          %td
            =f.label :number
            =f.text_field :number, disabled: true
        %tr
          %td
            =f.label :label
            =f.text_field :label, required: true
        %tr
          %td
            =f.label :phoneable_type
            .radio_box
              = f.radio_button :phoneable_type, "User"
              = f.label "User"
            .radio_box
              = f.radio_button :phoneable_type, "Group"
              = f.label "Group"
        %tr
          %td
            =f.label :phoneable
            -if @plivo_number.phoneable.class == User
              =f.select :phoneable_id, User.all.map{|u| [u.full_name, u.id]}
            -else
              =f.select :phoneable_id, Group.all.map{|u| [u.full_name, u.id]}
        %tr
          %td
            =f.submit "Save"
            =link_to "Cancel", admin_plivo_index_path
        :javascript
          jQuery(document).ready(function(){
            jQuery('#plivo_number_phoneable_type_user').click(function(){
              jQuery("#plivo_number_phoneable_id").replaceWith('#{ j f.select :phoneable_id,  User.all.map{|u| [u.full_name, u.id]}}');
            });
            jQuery('#plivo_number_phoneable_type_group').click(function(){
              jQuery("#plivo_number_phoneable_id").replaceWith('#{ j f.select :phoneable_id,  Group.all.map{|u| [u.full_name, u.id]}}');
            });
          })


{'fraction_non_alphanumeric': 0.12629213483146068, 'fraction_numerical': 0.0, 'mean_word_length': 1.7080291970802919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3851413', 'n_tokens_mistral': 710, 'n_tokens_neox': 703, 'n_words': 139}