def draw_belongs_to_label(f, popup_path, col_name, model = f.object.class)
      col   = model.columns.detect{|c| c.name == col_name.to_s}
      return "no column found" if !col

      parent_model = model.belongs_to_AR(col)
      return "parent_model is nil" if !parent_model

      link_to(
          draw_belongs_to_label_sub(model, col.name, parent_model).html_safe +
          Settings.edgarj.belongs_to.link_tag.html_safe,
          popup_path,
          remote: true)
    end
def draw_belongs_to_label(f, popup_path, col_name, model = f.object.class)
      col   = model.columns.detect{|c| c.name == col_name.to_s}
      return "no column found" if !col

      parent_model = model.belongs_to_AR(col)
      return "parent_model is nil" if !parent_model

      link_to(
          draw_belongs_to_label_sub(model, col.name, parent_model).html_safe +
          Settings.edgarj.belongs_to.link_tag.html_safe,
          popup_path,
          remote: true)
    end
=begin
    # draw belongs_to name.  When link=true(default), draw it as hyper-link
    def draw_belongs_to(parent_obj, link=true)
        if link
          link_to( parent_obj.name,
              controller: '/' + parent_obj.class.name.underscore.pluralize,
              action:     'show',
              id:         parent_obj.id)
        else
          h(parent_obj.name)
        end
    end
=end
 draw 'belongs_to' popup button(link) label.  This is used at:

 * edgarj form for data entry
 * edgarj search form(Edgarj::SearchForm) for search-condition entry

 === INPUTS
 @param f          [FormBuilder] FormBuilder object
 @param popup_path [String]      popup path(url)
 @param col_name   [String]      'belongs_to' column name
 @param model      [AR]          data model class