Method: Fullstack::Cms::Configuration#setting
- Defined in:
- lib/fullstack/cms/configuration.rb
#setting(key, options = {}) ⇒ Object
config.setting(‘description’, :kind => :text, :localized => true, :group => group) setting(‘website/description’, :locale => I18n.locale)
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/fullstack/cms/configuration.rb', line 58 def setting(key, = {}) return nil unless Setting.table_exists? = .reverse_merge({ :localized => localized? }).merge({ :autocreate => true }) localized_setting = .delete(:localized) if localized_setting && localized? # ignores the option if CMS is not localized I18n.available_locales.each do |locale| Setting.global(key.to_s, .merge(:locale => locale.to_s)) end else Setting.global(key.to_s, ) end end |