Sha256: 35b64f2e63d8b19bd91c08310ba28756b757995f3b8f45e7fa2fa6f310387ed3
Contents?: true
Size: 690 Bytes
Versions: 2
Compression:
Stored size: 690 Bytes
Contents
# frozen-string-literal: true require "action_view/helpers/tags/hidden_field" module EncryptedFormFields module Helpers class EncryptedField < ActionView::Helpers::Tags::HiddenField def initialize(object_name, method_name, template_object, options = {}) super(object_name, method_name, template_object, options.dup) value = @options.with_indifferent_access.fetch("value") { value_before_type_cast(object) } @options["value"] = EncryptedFormFields.encrypt_and_sign(value) @object_name = EncryptedFormFields.prefix_name(@object_name) end class << self def field_type "hidden" end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
encrypted_form_fields-0.2.4 | lib/encrypted_form_fields/helpers/encrypted_field.rb |
encrypted_form_fields-0.2.3 | lib/encrypted_form_fields/helpers/encrypted_field.rb |