Sha256: fc528d205a72521fe454a90969b3e630699c5c04ac747dd14c510df3fc240eb3
Contents?: true
Size: 720 Bytes
Versions: 1
Compression:
Stored size: 720 Bytes
Contents
class SettingsController < ApplicationController respond_to :html before_filter :authenticate_user! def index @settings = Setting.unscoped.index_by(&:var) end def show render json: Setting[params[:id2] || params[:id]].to_json end def updates @settings = Setting.unscoped.index_by(&:var) params[:setting].each do |var, value| next if @settings[var].nil? && (value.nil? || value.strip == '') if @settings[var] && value.strip == '' Setting.destroy var else value = Setting.new(var: var, value: value).cast_value Setting[var] = value end end redirect_to settings_path, notice: t('settings.updates.done') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
home_page-0.0.6 | app/controllers/settings_controller.rb |