Extract available languages

#640
This commit is contained in:
Artur Beljajev 2017-11-23 10:17:59 +02:00
parent 77b24fdbd1
commit 5f69067d35
3 changed files with 10 additions and 2 deletions

View file

@ -16,6 +16,8 @@ class ApplicationController < ActionController::Base
end
helper_method :registrant_request?, :registrar_request?, :admin_request?, :current_root_url
helper_method :available_languages
def registrant_request?
request.path.match(/^\/registrant/)
end
@ -79,4 +81,10 @@ class ApplicationController < ActionController::Base
return if params[parent_key][key].blank?
params[parent_key][key].sub!(/,/, '.')
end
private
def available_languages
{ en: 'English', et: 'Estonian' }.invert
end
end