lipsiadmin 3.1 → 3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Rakefile +1 -1
- data/lib/data_base/attachment.rb +8 -3
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/data_base/attachment.rb
CHANGED
@@ -37,7 +37,12 @@ module Lipsiadmin
|
|
37
37
|
#
|
38
38
|
# Then in your form (with multipart) you can simply add:
|
39
39
|
#
|
40
|
-
# =
|
40
|
+
# =file_field_tag "yourmodel[image_attributes][file]"
|
41
|
+
#
|
42
|
+
# or
|
43
|
+
#
|
44
|
+
# -fields_for "yourmodel[image_attributes][file]", @yourmodel.build_image do |image|
|
45
|
+
# =image.file_field :file
|
41
46
|
#
|
42
47
|
def has_one_attachment(name, options={})
|
43
48
|
options[:as] ||= :attacher
|
@@ -73,7 +78,7 @@ module Lipsiadmin
|
|
73
78
|
if file_column = self.send(name)
|
74
79
|
file_column.update_attributes(attributes)
|
75
80
|
else
|
76
|
-
self.send(name
|
81
|
+
self.send("build_#{name}", attributes)
|
77
82
|
end
|
78
83
|
|
79
84
|
end
|
@@ -91,7 +96,7 @@ module Lipsiadmin
|
|
91
96
|
#
|
92
97
|
# Then in your form (with multipart) you can simply add:
|
93
98
|
#
|
94
|
-
#
|
99
|
+
# -fields_for "yourmodel[images_attributes][]", @yourmodel.images.build do |image|
|
95
100
|
# =image.file_field :file
|
96
101
|
#
|
97
102
|
def has_many_attachments(name, options = {})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lipsiadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "3.
|
4
|
+
version: "3.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Davide D'Agostino
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-10 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|