Sha256: 548edf5b6f4462b4ee2e694b0c733fcef5ac5a05cd7a50e3a0ae8e7091f098c4

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

module SignedForm
  module ActionView
    module FormHelper

      # This is a wrapper around ActionView's form_for helper.
      #
      # @option options :sign_destination [Boolean] Only the URL given/created will be allowed to receive the form.
      def signed_form_for(record, options = {}, &block)
        options[:builder] ||= SignedForm::FormBuilder

        form_for(record, options) do |f|
          output = capture(f, &block)
          f.form_signature_tag + output
        end
      end
    end
  end
end

ActionView::Base.send :include, SignedForm::ActionView::FormHelper

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
signed_form-0.1.2 lib/signed_form/action_view/form_helper.rb
signed_form-0.1.1 lib/signed_form/action_view/form_helper.rb
signed_form-0.1.0 lib/signed_form/action_view/form_helper.rb