Sha256: b8ffba574457d4b209ba995fe53cce1722c99f599014c272c4d82014b7c0bfa4

Contents?: true

Size: 650 Bytes

Versions: 3

Compression:

Stored size: 650 Bytes

Contents

require_dependency "antispam/application_controller"

module Antispam
  class BlocksController < ApplicationController
    before_action :must_be_admin
    before_action :set_block, only: [:show]

    # GET /blocks
    def index
      @blocks = Block.all
    end

    # GET /blocks/1
    def show
    end

    private
      # Use callbacks to share common setup or constraints between actions.
      def set_block
        @block = Block.find(params[:id])
      end

      # Only allow a list of trusted parameters through.
      def block_params
        params.require(:block).permit(:ip, :provider, :controllername, :actionname)
      end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
antispam-0.2.0 app/controllers/antispam/blocks_controller.rb
antispam-0.1.7 app/controllers/antispam/blocks_controller.rb
antispam-0.1.5 app/controllers/antispam/blocks_controller.rb