Sha256: 490e0786b11893797d53dc6db9ce81e89a70c0795d9163d53a0a42429a5bc350

Contents?: true

Size: 581 Bytes

Versions: 3

Compression:

Stored size: 581 Bytes

Contents

class ::Admin::SettingsController < ::Admin::BaseController
  authorize_resource class: Settings

  defaults resource_class: Settings

  def update
    Settings.instance.save(params.require(:settings).permit!.to_h)
    Settings.reload_checker.expire
    redirect_back fallback_location: admin_root_url
  end

  def cache_clear
    Rails.cache.clear
    head :ok
  end

  private

  def action_items
    []
  end

  def collection
    @settings ||= Settings.instance.editable
  end

  def collection_path
    admin_settings_path
  end

  def resource
    Settings.instance
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ab_admin-0.8.2 app/controllers/admin/settings_controller.rb
ab_admin-0.8.1 app/controllers/admin/settings_controller.rb
ab_admin-0.8.0 app/controllers/admin/settings_controller.rb