Sha256: 9ac1777eee445c807f4b5ce9f5c6ef6a8afa990ac5a0618a581d0b4f76591bd6
Contents?: true
Size: 558 Bytes
Versions: 41
Compression:
Stored size: 558 Bytes
Contents
# frozen_string_literal: true module Primer # Module to allow components to deal with the `test_selector` argument. # It will only add the selector if env is not Production. # # test_selecotr: "foo" => data-test-selector="foo" module TestSelectorHelper TEST_SELECTOR_TAG = :test_selector def add_test_selector(args) if args.key?(TEST_SELECTOR_TAG) && !Rails.env.production? args[:data] ||= {} args[:data][TEST_SELECTOR_TAG] = args[TEST_SELECTOR_TAG] end args.except(TEST_SELECTOR_TAG) end end end
Version data entries
41 entries across 41 versions & 1 rubygems