Sha256: 8ae808776f49a3ebe9958a195716c2767accd0d52417ae414eae7b39f2ad9834

Contents?: true

Size: 755 Bytes

Versions: 30

Compression:

Stored size: 755 Bytes

Contents

require "action_view/helpers/asset_tag_helper"

# encoding: utf-8
module MgcaHelper
  
  def country_flag( lcl = I18n.locale.to_s, format = "small", style = "" )
    format = "medium" unless %w(small medium large).include?(format)
    lcl = "xx" unless %w(at by be ba bg ca hr cy cz dk fi fr de gr hu ie it lv li lt lu nl no pl pt ro ru rs sk si es se ch ua gb us).include?( lcl.to_s.downcase )
    classes = ["flag"]
    classes << style if style.present?
    raw(image_tag("flags/countries/#{format}/flag-#{lcl.to_s.downcase}.png", class: classes.join(" ")))
  end
  
  def address_admin_template(options = {}, &block)
    options.merge!(:body => capture(&block))
    render(:partial => "magic_addresses/admin_template", :locals => options)
  end
  
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
magic_addresses-0.0.44 lib/helpers/mgca_helper.rb
magic_addresses-0.0.43 lib/helpers/mgca_helper.rb
magic_addresses-0.0.42 lib/helpers/mgca_helper.rb
magic_addresses-0.0.41 lib/helpers/mgca_helper.rb
magic_addresses-0.0.40 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc8 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc7 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc6 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc5 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc4 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc3 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc2 lib/helpers/mgca_helper.rb
magic_addresses-0.0.39.rc1 lib/helpers/mgca_helper.rb
magic_addresses-0.0.38 lib/helpers/mgca_helper.rb
magic_addresses-0.0.38.beta2 lib/helpers/mgca_helper.rb
magic_addresses-0.0.38.beta1 lib/helpers/mgca_helper.rb
magic_addresses-0.0.37 lib/helpers/mgca_helper.rb
magic_addresses-0.0.36 lib/helpers/mgca_helper.rb
magic_addresses-0.0.35 lib/helpers/mgca_helper.rb