Sha256: 0730add5c63cdb1e27775935153e8e96b1310fcd259d4284f9df7b5f76b95b47

Contents?: true

Size: 454 Bytes

Versions: 1

Compression:

Stored size: 454 Bytes

Contents

module LanguageEngine::LanguagesHelper

  def selected_language?( lang)
    (session[:language].nil? && lang=="fr") || lang==session[:language].to_s
  end
  
  def language_class( lang)
    "language #{lang}".tap do |css_classes|
      css_classes << " selected" if selected_language?(lang)
    end
  end

  def link_to_language(language)
    link_to image_tag("language_engine/#{language}_flag.png"), language_path(language), :method => :put
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
language_engine-0.0.4 app/helpers/language_engine/languages_helper.rb