Sha256: 67cbae0771eb910e696b56100fff442cd1a175d53b8873152a61b82377ebde30

Contents?: true

Size: 460 Bytes

Versions: 6

Compression:

Stored size: 460 Bytes

Contents

module Locomotive
  module MyAccountHelper

    def options_for_locale
      Rails.cache.fetch("#{Locomotive::VERSION}/views/helpers/options_for_locale") do
        Locomotive.config.locales.map do |locale|
          flag_url = path_to_image "locomotive/icons/flags/#{locale}.png"

          [
            I18n.t("locomotive.locales.#{locale}"),
            locale,
            { :"data-flag" => flag_url }
          ]
        end
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
locomotivecms-3.1.2 app/helpers/locomotive/my_account_helper.rb
locomotivecms-3.1.1 app/helpers/locomotive/my_account_helper.rb
locomotivecms-3.1.0 app/helpers/locomotive/my_account_helper.rb
locomotivecms-3.1.0.rc3 app/helpers/locomotive/my_account_helper.rb
locomotivecms-3.1.0.rc2 app/helpers/locomotive/my_account_helper.rb
locomotivecms-3.1.0.rc1 app/helpers/locomotive/my_account_helper.rb