Sha256: ca0ef8af1d34b20e5f6fc456511874cb1dd2a997eb1ed9d4e42ee0f9149ecb9a

Contents?: true

Size: 663 Bytes

Versions: 58

Compression:

Stored size: 663 Bytes

Contents

module SettingsHelper

  # eg.
  # setting("blog/per_page", 20, :kind => :integer) 
  def setting(namespaced_key, *args)
    namespace_separator = "/"
    
    opts = args.extract_options!
    value = args.first
    namespaced_key = namespaced_key.to_s
    group, key =  namespaced_key.include?(namespace_separator) ? namespaced_key.split(namespace_separator) : [nil, namespaced_key]
    
    s = Setting.global("#{key}", :autocreate => false, :default => value, :group => group, :options => opts[:options], :locale => ((Fullstack::Cms.localized == false || opts[:locale] == false) ? nil : I18n.locale.to_s))
   
  end
    
  alias :get_setting :setting
  
end


Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
fullstack-cms-0.3.8.fix app/helpers/settings_helper.rb
fullstack-cms-0.2.32.fix app/helpers/settings_helper.rb
fullstack-cms-0.3.39 app/helpers/settings_helper.rb
fullstack-cms-0.3.38 app/helpers/settings_helper.rb
fullstack-cms-0.3.37 app/helpers/settings_helper.rb
fullstack-cms-0.3.36 app/helpers/settings_helper.rb
fullstack-cms-0.3.35 app/helpers/settings_helper.rb
fullstack-cms-0.3.34 app/helpers/settings_helper.rb
fullstack-cms-0.3.33 app/helpers/settings_helper.rb
fullstack-cms-0.3.32 app/helpers/settings_helper.rb
fullstack-cms-0.3.31 app/helpers/settings_helper.rb
fullstack-cms-0.3.30 app/helpers/settings_helper.rb
fullstack-cms-0.3.29 app/helpers/settings_helper.rb
fullstack-cms-0.3.28 app/helpers/settings_helper.rb
fullstack-cms-0.3.27 app/helpers/settings_helper.rb
fullstack-cms-0.3.26 app/helpers/settings_helper.rb
fullstack-cms-0.3.25 app/helpers/settings_helper.rb
fullstack-cms-0.3.24 app/helpers/settings_helper.rb
fullstack-cms-0.3.23 app/helpers/settings_helper.rb
fullstack-cms-0.3.22 app/helpers/settings_helper.rb