回答編集履歴
2
誤字の修正
test
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
**BEFORE: controller/project_controller.rb**
|
46
46
|
|
47
|
-
```
|
47
|
+
```Ruby
|
48
48
|
|
49
49
|
#省略
|
50
50
|
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
**AFTER: controller/project_controller.rb**
|
72
72
|
|
73
|
-
```
|
73
|
+
```Ruby
|
74
74
|
|
75
75
|
#省略
|
76
76
|
|
1
前後比較の追加
test
CHANGED
@@ -6,7 +6,9 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
### veiw
|
10
|
+
|
9
|
-
**BEFORE:
|
11
|
+
**BEFORE: view/project/confirm.html.haml**
|
10
12
|
|
11
13
|
```Haml
|
12
14
|
|
@@ -22,9 +24,7 @@
|
|
22
24
|
|
23
25
|
```
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
**AFTER:
|
27
|
+
**AFTER: view/project/confirm.html.haml**
|
28
28
|
|
29
29
|
```Haml
|
30
30
|
|
@@ -32,10 +32,66 @@
|
|
32
32
|
|
33
33
|
.inputField
|
34
34
|
|
35
|
-
= image_tag(@project.image.url)
|
35
|
+
= image_tag(@project.image.url)#ここを変更
|
36
36
|
|
37
|
-
= hidden_field_tag :"cache[image]", @project.image.cache_name
|
37
|
+
= hidden_field_tag :"cache[image]", @project.image.cache_name #ここを変更
|
38
38
|
|
39
39
|
#省略
|
40
40
|
|
41
41
|
```
|
42
|
+
|
43
|
+
### controller
|
44
|
+
|
45
|
+
**BEFORE: controller/project_controller.rb**
|
46
|
+
|
47
|
+
```Haml
|
48
|
+
|
49
|
+
#省略
|
50
|
+
|
51
|
+
def complete
|
52
|
+
|
53
|
+
@project = Project.new(project_params)
|
54
|
+
|
55
|
+
if @project.save!
|
56
|
+
|
57
|
+
redirect_to :action => 'admin_index'
|
58
|
+
|
59
|
+
else
|
60
|
+
|
61
|
+
render :action => 'new'
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
#省略
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
**AFTER: controller/project_controller.rb**
|
72
|
+
|
73
|
+
```Haml
|
74
|
+
|
75
|
+
#省略
|
76
|
+
|
77
|
+
def complete
|
78
|
+
|
79
|
+
@project = Project.new(project_params)
|
80
|
+
|
81
|
+
@project.image.retrieve_from_cache! params[:cache][:image] #これを追加
|
82
|
+
|
83
|
+
if @project.save!
|
84
|
+
|
85
|
+
redirect_to :action => 'admin_index'
|
86
|
+
|
87
|
+
else
|
88
|
+
|
89
|
+
render :action => 'new'
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
#省略
|
96
|
+
|
97
|
+
```
|