def draw_belongs_to_label_sub(model, col_name, parent_model)
      @controller_model ||= controller.send(:model)

      I18n.t(col_name,
          scope:    "view.#{controller_path}.#{@controller_model.name.underscore}",
          default:  model.human_attribute_name(col_name,
              default:  parent_model.human_name))
    end
def draw_belongs_to_label_sub(model, col_name, parent_model)
      @controller_model ||= controller.send(:model)

      I18n.t(col_name,
          scope:    "view.#{controller_path}.#{@controller_model.name.underscore}",
          default:  model.human_attribute_name(col_name,
              default:  parent_model.human_name))
    end
=begin
    # remote_function + spinner
    def edgarj_remote_function(url, method='get')
      "Edgarj._simple_ajax('#{j(url_for(url))}', '#{method}')"
    end

    # form_for which supports Ajax-like file upload.
    #
    # In order to support Ajax-like file upload, use
    # form-target-iframe-responds_to_parent mechanism.
    def edgarj_form(&block)
      url_hash = {
        controller: params[:controller],
        action:     @model.new_record? ? 'create' : 'update',
        format:     :js
      }
      url_hash[:id] = @model.id if @model.persisted?
      form_for(@model,
          remote: true,
          url:    url_hash,
          html:   {
              id:         '_edgarj_form',
              method:     @model.new_record? ? 'post' : 'put',
              multipart:  true,
             #target:     'edgarj_form_frame'
          }, &block)
    end

    # According to http://khamsouk.souvanlasy.com/articles/ajax_file_uploads_in_rails
    # 'display:none' style should *NOT* used:
    def iframe_for_edgarj_form
      %Q(<iframe id=edgarj_form_frame name=edgarj_form_frame
        style='width:1px;height:1px;border:0px' src='about:blank'></iframe>
      ).html_safe
    end

    # === INPUTS
    # o::       operator form builder
    # method::  column name
    def draw_search_operator(o, method)
      render '/edgarj/search_operator',
          o:        o,
          method:   method
    end

    # Edgarj standard datetime format
    def datetime_fmt(dt)
      if dt.blank? then
        ''
      else
        I18n.l(dt, format: I18n.t('edgarj.time.format'))
      end
    end

    # Edgarj standard date format
    def date_fmt(dt)
      if dt == nil then
        ''
      else
        dt.strftime(I18n.t('date.formats.default'))
      end
    end

    def draw_view_status_load_menu
      content_tag(:div, :id=>'edgarj_load_condition_menu', :class=>'edgarj_menu') do
        content_tag(:table) do
          content_tag(:tr) do
            if current_user.saved_view_statuss.count(:conditions=>['view=?', controller_name]) > 0
              draw_menu_top_and_pulldown('saved_conditions', t('load_condition')) do
                out = ""
                for svc in current_user.saved_view_statuss.find_all_by_view(controller_name) do
                  out += edgarj_link_to_remote(
                                svc.name, {:action=>'search_load', :id=>svc.id})
                end
                out
              end
            else
              # not to draw empty sub menu of 'saved_conditions' 
              ''
            end +
            content_tag(:td) do
              link_to 'Help', url_for(:controller=>'/help',
                                :action=>'search.html'), {:target=>'help'}
            end
          end
        end
      end
    end

    # draw sort link on list column header
    #
    # === INPUTS
    # col::         column data
    # options::     options to url_for
    def draw_sort(col, options={})
      label = model_class.human_attribute_name(col.name)
      dir   = 'asc'
      if @view_status.order_by == col.name
        # toggle direction
        if @view_status.dir == 'asc' || @view_status.dir.blank?
          label += '▲'
          dir    = 'desc'
        else
          label += '▼'
        end
      end
      link_to(label,
          {
          :controller                   => params[:controller],
          :action                       => 'view_status_save',
          :id                           => @view_status.id,
          'edgarj_view_status[order_by]' => col.name,
          'edgarj_view_status[dir]'      => dir
          }.merge(options),
          :remote => true,
          :method => :put)
    end
=end
 1. t('view.CONTROLLER.MODEL.COL_NAME')
 1. MODEL.human_attribute_name(COL_NAME)
 1. else, parent.human_name is used.