mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
parent
77b24fdbd1
commit
5f69067d35
3 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -14,7 +14,7 @@ module FormHelper
|
|||
end
|
||||
|
||||
def language_select(object, method, choices = nil, options = {}, html_options = {}, &block)
|
||||
choices = options_for_select({ en: 'English', et: 'Estonian' }.invert, options[:selected])
|
||||
choices = options_for_select(available_languages, options[:selected])
|
||||
select(object, method, choices, options, html_options, &block)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
%td.col-md-6= label_tag :default_language
|
||||
%td.col-md-6
|
||||
= select_tag '[settings][default_language]',
|
||||
options_for_select({ en: 'English', et: 'Estonian' }.invert, Setting.default_language),
|
||||
options_for_select(available_languages, Setting.default_language),
|
||||
class: 'form-control'
|
||||
|
||||
.panel.panel-default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue