lib/browser_war_helper.rb
#Converts the options hash's values to javascript
Converts the options hash's values to javascript
Converts the options hash ' s values to javascript
def options_to_javascript(options)
    set_to_null = browserwar_options_default
    options.each do |key,value|
      options[key] = value.blank? ? "null" : (value == true || value == false) ? "#{value}" : "'#{value}'"
      set_to_null.delete(key)
    end
    set_to_null.each do |key,value|
      options.merge({key => "null"})
    end
    options
  end
def options_to_javascript ( options ) set_to_null = browserwar_options_default options . each do | key , value | options [ key ] = value . blank? ? "null" : ( value == true || value == false ) ? "#{value}" : "'#{value}'" set_to_null . delete ( key ) end set_to_null . each do | key , value | options . merge ( { key => "null" } ) end options end
Converts the options hash's values to javascript
Converts the options hash ' s values to javascript
#Convert the passed in options to be javascript #Any key that is defined in the options hash will not need to be set to "null", so remove it from set_to_null #If not all the available options were in the passed in options hash, then we need to set them to "null" 
options