Method: Releaf::RootController#store_settings
- Defined in:
- app/controllers/releaf/root_controller.rb
#store_settings ⇒ Object
Store settings for menu collapsing and others
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/releaf/root_controller.rb', line 15 def store_settings settings = params.permit(settings: [:key, :value]).to_h.fetch(:settings, nil) if settings settings.each do|item| next if item[:key].nil? || item[:value].nil? item[:value] = true if item[:value] == "true" item[:value] = false if item[:value] == "false" Releaf.application.config.settings_manager.write(controller: self, key: item[:key], value: item[:value]) end head :ok else head :unprocessable_entity end end |