Adding fix for AjaxHelper::form() (Ticket #3582)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6104 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-12-02 22:42:59 +00:00
parent 73d4844b22
commit a61b32c91e
2 changed files with 8 additions and 0 deletions

View file

@ -318,6 +318,9 @@ class AjaxHelper extends AppHelper {
),
$options
);
foreach (array_keys($options) as $key) {
unset($htmlOptions[$key]);
}
return $this->Form->create($options['model'], $htmlOptions)
. $this->Javascript->event("'" . $htmlOptions['id']. "'", 'submit', $this->remoteFunction($options));

View file

@ -115,6 +115,11 @@ class AjaxTest extends UnitTestCase {
$this->assertEqual($result, $expected);
}
function testForm() {
$result = $this->Ajax->form('showForm', 'post', array('model' => 'Form', 'url' => array('action' => 'showForm', 'controller' => 'forms'), 'update' => 'form_box'));
$this->assertNoPattern('/model=/', $result);
}
function testSortable() {
$result = $this->Ajax->sortable('ull', array('constraint'=>false,'ghosting'=>true));
$expected = '<script type="text/javascript">Sortable.create(\'ull\', {constraint:false, ghosting:true});</script>';