回答編集履歴
2
修正
test
CHANGED
@@ -44,6 +44,8 @@
|
|
44
44
|
|
45
45
|
$this->render('index');
|
46
46
|
|
47
|
+
return;
|
48
|
+
|
47
49
|
}
|
48
50
|
|
49
51
|
```
|
1
追記
test
CHANGED
@@ -25,3 +25,25 @@
|
|
25
25
|
$this->render('confirm');
|
26
26
|
|
27
27
|
```
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
**(追記)**
|
32
|
+
|
33
|
+
今回の場合は、confirmアクションで、バリデートに失敗したらindexビューを描画するのがいいかもしれません。
|
34
|
+
|
35
|
+
```php
|
36
|
+
|
37
|
+
```php
|
38
|
+
|
39
|
+
$this->Contact->set($this->request->data);
|
40
|
+
|
41
|
+
if(!$this->Contact->validates()){
|
42
|
+
|
43
|
+
$this->Session->setFlash('バリデート失敗');
|
44
|
+
|
45
|
+
$this->render('index');
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
```
|