Method: Lifeform::Form#verify_method

Defined in:
lib/lifeform/form.rb

#verify_methodObject



147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/lifeform/form.rb', line 147

def verify_method
  return if %w[get post].include?(parameters[:method].to_s.downcase)

  method_value = @parameters[:method].to_s.downcase

  @method_tag = -> {
    "      <input type=\"hidden\" name=\"_method\" value=\"\#{text -> { method_value }}\" autocomplete=\"off\">\n    HTML\n  }\n\n  parameters[:method] = :post\nend\n"