Sha256: 583a7f713b603f070e391404f9fa740e1eb08e220eb6f33491cd59bdd1752fd1
Contents?: true
Size: 768 Bytes
Versions: 18
Compression:
Stored size: 768 Bytes
Contents
class Admin::SettingsController < Admin::BaseController def show unless current_user.admin? flash.now[:notice] = 'You may view settings but editing is only available to Adminstrators.' end @settings = Settings end def update unless current_user.admin? flash[:notice] = 'You may view settings but editing is only available to Adminstrators.' else params[:settings].each_pair do |key,value| Settings[key] = value.strip end flash.now[:notice] = "Setting#{params[:settings].length>1?'s':''} #{params[:settings].collect{|s,v| s.humanize}.join(', ')} was successfully updated." end respond_to do |format| format.html { redirect_to admin_setting_path} format.js end end end
Version data entries
18 entries across 18 versions & 1 rubygems