Sha256: 8021eefd60eba15d5b787bfcc67672a9d2296aec4ea62861548abcfe0d2e2c4a

Contents?: true

Size: 685 Bytes

Versions: 4

Compression:

Stored size: 685 Bytes

Contents

require 'active_admin/extensions/controller/action_status'

module ActiveAdmin

  module Extensions

    module Controller

      module FlashMessages

        module Update
          include ::ActiveAdmin::Extensions::Controller::ActionStatus

          def update
            super() do |success, failure|
              if action_successful?
                flash.notice = I18n.t(
                  'active_admin.extensions.controller.flash_messages.update',
                  resource: resource.class.model_name.human
                )
              end
              yield(success, failure) if block_given?
            end
          end
        end

      end

    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_admin-extensions-0.0.4 lib/active_admin/extensions/controller/flash_messages/update.rb
active_admin-extensions-0.0.3 lib/active_admin/extensions/controller/flash_messages/update.rb
active_admin-extensions-0.0.2 lib/active_admin/extensions/controller/flash_messages/update.rb
active_admin-extensions-0.0.1 lib/active_admin/extensions/controller/flash_messages/update.rb