質問編集履歴
10
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,9 +42,9 @@
|
|
42
42
|
|
43
43
|
|
44
44
|
|
45
|
-
ちなみにgithubのcarrierwaveuploader/carrierwaveの
|
45
|
+
ちなみに[githubのcarrierwaveuploader/carrierwaveの
|
46
46
|
|
47
|
-
carrierwave/lib/carrierwave/uploader/store.rbには
|
47
|
+
carrierwave/lib/carrierwave/uploader/store.rb](https://github.com/carrierwaveuploader/carrierwave/blob/a2c93fe1a9d3a3f60d1662e5ec34fdba7bf2b304/lib/carrierwave/uploader/store.rb)には
|
48
48
|
|
49
49
|
```
|
50
50
|
|
9
文法ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -92,12 +92,12 @@
|
|
92
92
|
|
93
93
|
色々関連ページ↓
|
94
94
|
|
95
|
-
http://stackoverflow.com/questions/18460686/carrierwave-file-hash-and-model-id-in-filename-store-dir
|
95
|
+
[その1](http://stackoverflow.com/questions/18460686/carrierwave-file-hash-and-model-id-in-filename-store-dir)
|
96
96
|
|
97
97
|
|
98
98
|
|
99
|
-
https://groups.google.com/forum/#!topic/carrierwave/5yiZmAPfMPk
|
99
|
+
[その2](https://groups.google.com/forum/#!topic/carrierwave/5yiZmAPfMPk)
|
100
100
|
|
101
101
|
|
102
102
|
|
103
|
-
https://www.reddit.com/r/rails/comments/3aza77/help_how_do_i_get_carrierwave_to_display_modelid/
|
103
|
+
[その3](https://www.reddit.com/r/rails/comments/3aza77/help_how_do_i_get_carrierwave_to_display_modelid/)
|
8
関連ページのリンクを貼った
test
CHANGED
File without changes
|
test
CHANGED
@@ -85,3 +85,19 @@
|
|
85
85
|
```
|
86
86
|
|
87
87
|
とありますね。。。これどうしようもないやつなのかな。。
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
色々関連ページ↓
|
94
|
+
|
95
|
+
http://stackoverflow.com/questions/18460686/carrierwave-file-hash-and-model-id-in-filename-store-dir
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
https://groups.google.com/forum/#!topic/carrierwave/5yiZmAPfMPk
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
https://www.reddit.com/r/rails/comments/3aza77/help_how_do_i_get_carrierwave_to_display_modelid/
|
7
codeの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
def filename
|
28
28
|
|
29
|
-
"#{model.id}.
|
29
|
+
"#{model.id}.#{file.extension}" if original_filename
|
30
30
|
|
31
31
|
end
|
32
32
|
|
6
タイトル改善
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
railsのCarrierWaveでuploadした画像のfilename
|
1
|
+
railsのCarrierWaveでuploadした画像のfilenameの仕様限界を突破したい件
|
test
CHANGED
File without changes
|
5
タイトル修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails
|
1
|
+
railsのCarrierWaveでuploadした画像のfilenameを#{model.id}.jpgにできない仕様だけど何とか#{model.id}.jpgにしたい
|
test
CHANGED
File without changes
|
4
タイトル更新
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
railsでCarrierWave
|
1
|
+
railsでCarrierWaveでuploadした画像のfilenameを#{model.id}.jpgにできない仕様だけど何とか#{model.id}.jpgにしたい
|
test
CHANGED
File without changes
|
3
tag追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
タイトル改善
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails
|
1
|
+
railsでCarrierWaveを使うとき、filenameをmodel.idにできないけど何とかmodel.idにしたい
|
test
CHANGED
File without changes
|
1
書式改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -5,6 +5,20 @@
|
|
5
5
|
参考↓ (app/uploaders/image_uploader.rb)
|
6
6
|
|
7
7
|
```
|
8
|
+
|
9
|
+
class ImageUploader < CarrierWave::Uploader::Base
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
###省略
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
8
22
|
|
9
23
|
# Override the filename of the uploaded files:
|
10
24
|
|
@@ -15,6 +29,10 @@
|
|
15
29
|
"#{model.id}.jpg" if original_filename
|
16
30
|
|
17
31
|
end
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
end
|
18
36
|
|
19
37
|
```
|
20
38
|
|