module Forme::ERB::Helper

This is the module used to add the Forme integration to ERB templates, with optional support for rack_csrf for CSRF handling.

Private Instance Methods

_forme_form_options(obj, attr, opts) click to toggle source
   # File lib/forme/erb.rb
14 def _forme_form_options(obj, attr, opts)
15   super
16 
17   if defined?(::Rack::Csrf) && env['rack.session']
18     opts[:_before_post] = lambda do |form|
19       form.tag(:input, :type=>:hidden, :name=>::Rack::Csrf.field, :value=>::Rack::Csrf.token(env))
20     end
21   end
22 end