app/helpers/application_helper.rb
def create_extjs_button_config( action_title_i19n_sym, action_title_i19n_scope_sym,
                                  location_href_path, image_name = "cog.png" )
    action_text  = I18n.t( action_title_i19n_sym.to_sym, {:scope => [action_title_i19n_scope_sym ? action_title_i19n_scope_sym.to_sym : nil]} )
    tooltip_text = I18n.t( "#{action_title_i19n_sym}_tooltip".to_sym, {:scope => [action_title_i19n_scope_sym ? action_title_i19n_scope_sym.to_sym : nil]} )
    action_text.gsub!(/'/,'_')                      # Safety quote removal to avoid JS parsing errors
    tooltip_text.gsub!(/'/,'_')

    raw <<-JS
      {
        xtype: 'button',
        icon: '/images/icons/#{ image_name }',
        text: "#{ action_text }",
        tooltip: "#{ tooltip_text }",
        margin: '0 3 3 3',
        handler: function() {
          location.href = "#{ location_href_path }";
        }
      }
    JS
  end
# Generates an ExtJS Button widget configuration to be used inside an items list of
# a panel container.
#
# == Params:
#
# <tt>action_title_i19n_sym</tt> => Symbol for the I18n title for the button. The method assumes also that
#                                   a tooltip symbol is defined with a "_tooltip" appended on the title symbol
# <tt>action_title_i19n_scope_sym</tt> => Symbol for the I18n scope of the localization;
#                                         it can be nil for using the default global scope
# <tt>location_href_path</tt> => URL path to be executed upon button click 
# <tt>image_name</tt> => file name for the image to be used in the button, searched under "/images/icons"
#
Generates an ExtJS Button widget configuration to be used inside an items list of
a panel container.



action_title_i19n_sym => Symbol for the I18n title for the button. The method assumes also that
a tooltip symbol is defined with a "_tooltip" appended on the title symbol
action_title_i19n_scope_sym => Symbol for the I18n scope of the localization;
it can be nil for using the default global scope
location_href_path => URL path to be executed upon button click
image_name => file name for the image to be used in the button, searched under "/images/icons"
Generates an ExtJS Button widget configuration to be used inside an items list of a panel container . action_title_i19n_sym = > Symbol for the I18n title for the button . The method assumes also that a tooltip symbol is defined with a " _tooltip " appended on the title symbol action_title_i19n_scope_sym = > Symbol for the I18n scope of the localization ; it can be nil for using the default global scope location_href_path = > URL path to be executed upon button click image_name = > file name for the image to be used in the button searched under " / images / icons "
def create_extjs_button_config( action_title_i19n_sym, action_title_i19n_scope_sym,
                                  location_href_path, image_name = "cog.png" )
    action_text  = I18n.t( action_title_i19n_sym.to_sym, {:scope => [action_title_i19n_scope_sym ? action_title_i19n_scope_sym.to_sym : nil]} )
    tooltip_text = I18n.t( "#{action_title_i19n_sym}_tooltip".to_sym, {:scope => [action_title_i19n_scope_sym ? action_title_i19n_scope_sym.to_sym : nil]} )
    action_text.gsub!(/'/,'_')                      
    tooltip_text.gsub!(/'/,'_')
    raw <<-JS
      {
        xtype: 'button',
        icon: '/images/icons/#{ image_name }',
        text: "#{ action_text }",
        tooltip: "#{ tooltip_text }",
        margin: '0 3 3 3',
        handler: function() {
          location.href = "#{ location_href_path }";
        }
      }
    JS
  end
def create_extjs_button_config ( action_title_i19n_sym , action_title_i19n_scope_sym , location_href_path , image_name = "cog.png" ) action_text = I18n . t ( action_title_i19n_sym . to_sym , { :scope => [ action_title_i19n_scope_sym ? action_title_i19n_scope_sym . to_sym : nil ] } ) tooltip_text = I18n . t ( "#{action_title_i19n_sym}_tooltip" . to_sym , { :scope => [ action_title_i19n_scope_sym ? action_title_i19n_scope_sym . to_sym : nil ] } ) action_text . gsub! ( / ' / , '_' ) tooltip_text . gsub! ( / ' / , '_' ) raw <<-JS 
      {
        xtype: 'button',
        icon: '/images/icons/ #{ image_name } ',
        text: " #{ action_text } ",
        tooltip: " #{ tooltip_text } ",
        margin: '0 3 3 3',
        handler: function() {
          location.href = " #{ location_href_path } ";
        }
      }
     JS end
Generates an ExtJS Button widget configuration to be used inside an items list of
a panel container.
Generates an ExtJS Button widget configuration to be used inside an items list of a panel container .
# Safety quote removal to avoid JS parsing errors
action_title_i19n_sym
action_title_i19n_scope_sym
location_href_path
image_name