Module: Lesli::SystemHelper
- Defined in:
- app/helpers/lesli/system_helper.rb
Instance Method Summary collapse
-
#is_lesli_onboarding? ⇒ Boolean
return true if the controller requested belongs to the administration area.
-
#language_flag(locale) ⇒ Object
return flag code according to locale code.
-
#language_name(locale) ⇒ Object
return the name of the language.
-
#language_url(locale) ⇒ Object
build a url path to change locales.
-
#lesli_controller ⇒ Object
return the engine code of the controller that is handling the http request.
-
#lesli_engine(property = nil) ⇒ Object
return the information about the current engine.
-
#lesli_instance_code ⇒ Object
retun the code of the instance builder engine example: lesli_cloud, deutsche_leibrenten, mitwerken_cloud.
Instance Method Details
#is_lesli_onboarding? ⇒ Boolean
return true if the controller requested belongs to the administration area
70 71 72 |
# File 'app/helpers/lesli/system_helper.rb', line 70 def is_lesli_onboarding? lesli_controller == "onboardings" end |
#language_flag(locale) ⇒ Object
return flag code according to locale code
42 43 44 45 |
# File 'app/helpers/lesli/system_helper.rb', line 42 def language_flag(locale) locale = "gb" if locale.to_s == "en" locale end |
#language_name(locale) ⇒ Object
return the name of the language
48 49 50 |
# File 'app/helpers/lesli/system_helper.rb', line 48 def language_name(locale) Lesli.config.locales.dig(locale) || "undefined" end |
#language_url(locale) ⇒ Object
build a url path to change locales
37 38 39 |
# File 'app/helpers/lesli/system_helper.rb', line 37 def language_url(locale) "/lesli/language?locale=#{locale}" end |
#lesli_controller ⇒ Object
return the engine code of the controller that is handling the http request
53 54 55 |
# File 'app/helpers/lesli/system_helper.rb', line 53 def lesli_controller controller_path.split("/")[0] end |
#lesli_engine(property = nil) ⇒ Object
return the information about the current engine
65 66 67 |
# File 'app/helpers/lesli/system_helper.rb', line 65 def lesli_engine(property = nil) LesliSystem.engine(lesli_controller, property) end |
#lesli_instance_code ⇒ Object
retun the code of the instance builder engine example: lesli_cloud, deutsche_leibrenten, mitwerken_cloud
59 60 61 62 |
# File 'app/helpers/lesli/system_helper.rb', line 59 def lesli_instance_code return "lesli" #LesliSystem.instance[:code] end |