Sha256: c7358c6ab0a2291a3630fc2e22a9300509f98d2973d3006feaf82f9e07057b11

Contents?: true

Size: 534 Bytes

Versions: 3

Compression:

Stored size: 534 Bytes

Contents

module Noindex
  module Controller

    module ClassMethods
      def noindex *args
        before_action :noindex, *args
      end

      def skip_noindex *args
        skip_before_action :noindex, *args
      end
    end

    module InstanceMethods
      def noindex
        @noindex = true
      end
    end

    def self.included(receiver)
      receiver.extend         ClassMethods
      receiver.send :include, InstanceMethods

      receiver.hide_action :noindex
      receiver.noindex only: [ :new, :edit ]
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
noindex-0.0.3 lib/noindex/controller.rb
noindex-0.0.2 lib/noindex/controller.rb
noindex-0.0.1 lib/noindex/controller.rb