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.34 lib/helpers/mgca_helper.rb
magic_addresses-0.0.33 lib/helpers/mgca_helper.rb
magic_addresses-0.0.32 lib/helpers/mgca_helper.rb
magic_addresses-0.0.31 lib/helpers/mgca_helper.rb
magic_addresses-0.0.30 lib/helpers/mgca_helper.rb
magic_addresses-0.0.29 lib/helpers/mgca_helper.rb
magic_addresses-0.0.28 lib/helpers/mgca_helper.rb
magic_addresses-0.0.27 lib/helpers/mgca_helper.rb
magic_addresses-0.0.26 lib/helpers/mgca_helper.rb
magic_addresses-0.0.25 lib/helpers/mgca_helper.rb