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

Version Path
beef-admin_area-0.1.6 app/controllers/admin/settings_controller.rb
beef-admin_area-0.1.7 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.9 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.8 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.7 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.6 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.4 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.3 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.2 app/controllers/admin/settings_controller.rb
beef-admin_area-0.3.0 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.6 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.5 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.4 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.3 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.2 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.1 app/controllers/admin/settings_controller.rb
beef-admin_area-0.2.0 app/controllers/admin/settings_controller.rb
beef-admin_area-0.1.9 app/controllers/admin/settings_controller.rb