def draw_form_buttons(options = {})
      content_tag(:table) do
        content_tag(:tr) do
          # save button
          content_tag(:td) do
            #cp_bitset = Edgarj::ModelPermission::FlagsBitset
            #create_or_update = cp_bitset::CREATE + cp_bitset::UPDATE
            tag(:input, {
                type:     'button',
                name:     'save',
                onClick:  '$("#_edgarj_form").submit()',
                value:    t('edgarj.default.save'),
                class:    '_edgarj_form_save',})
               #disabled: !permitted?(create_or_update)}.merge(options[:save]||{}))
          end +

          # search button
          content_tag(:td) do
            button_for_js(t('edgarj.default.search_form'), <<-JS,
                $('#edgarj_form').hide();
                $('#edgarj_search_form').show();
              JS
              {class: '_edgarj_form_search'}.merge(options[:search_form] ||{}))
          end +

          # clear button
          content_tag(:td) do
            button_to(t('edgarj.default.clear'),
                {action: 'clear'},
                {
                  method:   :get,
                  remote:   true,
                })
          end +

          # delete button
          content_tag(:td) do
            button_to(t('edgarj.default.delete'),
                if @record.new_record?
                    url_for('/')
                else
                    url_for({
                        controller: params[:controller],
                        action:     'destroy',
                        id:         @record.id})
                end,
                {
                  method:   :delete,
                  remote:   true,
                  data:     {confirm:  t('edgarj.form.delete_confirm')},
                  disabled: @record.new_record?   # || !permitted?(cp_bitset::DELETE),
                })
          end
        end
      end
    end
def draw_form_buttons(options = {})
      content_tag(:table) do
        content_tag(:tr) do
          # save button
          content_tag(:td) do
            #cp_bitset = Edgarj::ModelPermission::FlagsBitset
            #create_or_update = cp_bitset::CREATE + cp_bitset::UPDATE
            tag(:input, {
                type:     'button',
                name:     'save',
                onClick:  '$("#_edgarj_form").submit()',
                value:    t('edgarj.default.save'),
                class:    '_edgarj_form_save',})
               #disabled: !permitted?(create_or_update)}.merge(options[:save]||{}))
          end +

          # search button
          content_tag(:td) do
            button_for_js(t('edgarj.default.search_form'), <<-JS,
                $('#edgarj_form').hide();
                $('#edgarj_search_form').show();
              JS
              {class: '_edgarj_form_search'}.merge(options[:search_form] ||{}))
          end +

          # clear button
          content_tag(:td) do
            button_to(t('edgarj.default.clear'),
                {action: 'clear'},
                {
                  method:   :get,
                  remote:   true,
                })
          end +

          # delete button
          content_tag(:td) do
            button_to(t('edgarj.default.delete'),
                if @record.new_record?
                    url_for('/')
                else
                    url_for({
                        controller: params[:controller],
                        action:     'destroy',
                        id:         @record.id})
                end,
                {
                  method:   :delete,
                  remote:   true,
                  data:     {confirm:  t('edgarj.form.delete_confirm')},
                  disabled: @record.new_record?   # || !permitted?(cp_bitset::DELETE),
                })
          end
        end
      end
    end
Draw buttons for form.

 When no CREATE/UPDATE permission, save button is disabled.
 It can be overwritten by options[:save].

 When no DELETE permission, delete button is disabled.
 It can be overwritten by options[:delete].

 options may have:
 :save::         html options for 'save' button.
 :search_form::  html options for 'search_form' button.
 :delete::       html options for 'delete' button.