a tiny mvc framework for php using php-activerecord
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

pass form method to output_remote_form_around_closure

don't include form_authenticity_token for GET forms

+15 -8
+15 -8
lib/helpers/prototype_helper.php
··· 68 68 elseif (isset($options["with"])) 69 69 $js_options["parameters"] = $options["with"]; 70 70 71 - if (isset($js_options["parameters"])) 72 - $js_options["parameters"] .= " + '&"; 73 - else 74 - $js_options["parameters"] = "'"; 71 + if (isset($options["method"]) && 72 + strtolower($options["method"]) != "get") { 73 + if (isset($js_options["parameters"])) 74 + $js_options["parameters"] .= " + '&"; 75 + else 76 + $js_options["parameters"] = "'"; 75 77 76 - $js_options["parameters"] .= "authenticity_token=' + " 77 - . "encodeURIComponent('" 78 - . $this->controller->form_authenticity_token() . "')"; 78 + $js_options["parameters"] .= "authenticity_token=' + " 79 + . "encodeURIComponent('" 80 + . $this->controller->form_authenticity_token() . "')"; 81 + } 79 82 80 83 /* support onCreate, onSuccess, etc. */ 81 84 foreach ($options as $k => $v) ··· 124 127 $options["html"]["onsubmit"] .= $this->remote_function($options) 125 128 . "; return false;"; 126 129 127 - return $this->output_form_around_closure($url_or_obj, $options["html"], 130 + $h_options = $options["html"]; 131 + if (isset($options["method"])) 132 + $h_options["method"] = $options["method"]; 133 + 134 + return $this->output_form_around_closure($url_or_obj, $h_options, 128 135 $form_content); 129 136 } 130 137