make 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/make/form.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70616ccc2ecb97831d58bd6731363f2496c5aab5
|
4
|
+
data.tar.gz: a8a7472b78bd43124cf65178dae4e14272295b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19a824197a55ada82d465b74593df285cfb71bc8dfd5bbfe2efe75c916afca4a61d39afbd0e50b8a70f2f573193ab8d488423fab10ea845e75568c10d67961e8
|
7
|
+
data.tar.gz: 48e688f4ec8812110e3f7a6ffdf069c634335fab9da505d6cb449e7699921b6b98d3ec45d330cef4a4644afe5a6f06479a4785a6d9ca3e662d34b69b4a1dad46
|
data/lib/make/form.rb
CHANGED
@@ -58,15 +58,15 @@ class Form
|
|
58
58
|
# Similar to default, but instead of a hidden specific value you pass in an array and create a select/option field.
|
59
59
|
def select column, array, assoc = false
|
60
60
|
columnName = column.titleize
|
61
|
-
input = '<label>' + columnName + '</label><select name="' + column + '" value="' + @modelName+'['column + ']">'
|
61
|
+
input = '<label>' + columnName + '</label><select name="' + column + '" value="' + @modelName + '[' + column + ']">'
|
62
62
|
if assoc #if association is checked true
|
63
63
|
array.each do |id|
|
64
64
|
val = column[0...-3].capitalize.constantize.find(id).attributes.values[1]
|
65
|
-
input += '<option value="' + @modelName+'[' + id.to_s + ']">' + val.to_s + '</option>'
|
65
|
+
input += '<option value="' + @modelName +'[' + id.to_s + ']">' + val.to_s + '</option>'
|
66
66
|
end
|
67
67
|
else #if no associations exist for array
|
68
68
|
array.each do |item|
|
69
|
-
input += '<option value="' + @modelName+'[' + item.to_s + ']">' + item.to_s + '</option>'
|
69
|
+
input += '<option value="' + @modelName +'[' + item.to_s + ']">' + item.to_s + '</option>'
|
70
70
|
end
|
71
71
|
end
|
72
72
|
@potential_keys_to_ignore.push(column)
|
@@ -102,12 +102,12 @@ class Form
|
|
102
102
|
@formMiddle.push(input)
|
103
103
|
end
|
104
104
|
else
|
105
|
-
input = '<label>' + column.titleize + '</label><input type="text" name="'+ @modelName + '['+ column+']">'
|
105
|
+
input = '<label>' + column.titleize + '</label><input type="text" name="' + @modelName + '[' + column + ']">'
|
106
106
|
@formMiddle.push(input)
|
107
107
|
end
|
108
108
|
end
|
109
109
|
@defaults.each_pair do |key, value|
|
110
|
-
input = '<input type="hidden" name="'+ @modelName + '['+ key.to_s+']" value="'+value.to_s+'">'
|
110
|
+
input = '<input type="hidden" name="'+ @modelName + '[' + key.to_s + ']" value="' + value.to_s + '">'
|
111
111
|
puts input
|
112
112
|
puts @formMiddle
|
113
113
|
@formMiddle.push(input)
|