Sha256: d04f863cff637e0a6b6afa04e50ffe60dba9653123f6b32f8bdeb61271349600

Contents?: true

Size: 572 Bytes

Versions: 4

Compression:

Stored size: 572 Bytes

Contents

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

  defaults resource_class: Settings

  def update
    Settings.update(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
    @collection ||= Settings.editable_data
  end

  def collection_path
    admin_settings_path
  end

  def resource
    Settings.instance
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ab_admin-0.11.0 app/controllers/admin/settings_controller.rb
ab_admin-0.10.0 app/controllers/admin/settings_controller.rb
ab_admin-0.9.0 app/controllers/admin/settings_controller.rb
ab_admin-0.8.3 app/controllers/admin/settings_controller.rb