sarawong 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sarawong/header.rb +8 -1
- data/lib/sarawong.rb +4 -3
- 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: b98b7d878dbd7ed9166a3d5f55124f4a055bc702
|
4
|
+
data.tar.gz: 41dc99a461be509ad94b9805be07820ace61bbd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 464462a477343b28de7d1b3c20061670c30c760e62a8e18ca0ec795c9366c86ab1c54b6f52da2223a5cdd797d09d692ee39b7a5984aa12ac4572f3be4ea8461a
|
7
|
+
data.tar.gz: f015462aa3cc4ce0860c87d06f49bd7b153867981b84070cda6f261c8da7ed3ee261687055612b01c05f775e2678b863d4a4c2237f519a04df2b1e694ab1802a
|
data/lib/sarawong/header.rb
CHANGED
@@ -2,5 +2,12 @@ module Builder
|
|
2
2
|
def self.header(title)
|
3
3
|
return '<meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>'+title+'</title><meta name="description" content=""><meta name="viewport" content="width=device-width, initial-scale=1">'
|
4
4
|
end
|
5
|
-
|
5
|
+
def self.form(db, columnNames)
|
6
|
+
form = '<form action="/' + db + 's" method="post">'
|
7
|
+
columnNames.each do |column|
|
8
|
+
form = form + '<label>' + column.titleize + '</label><input type="text" name="'+column+'">'
|
9
|
+
end
|
10
|
+
form += '</form>'
|
11
|
+
return form
|
12
|
+
end
|
6
13
|
end
|
data/lib/sarawong.rb
CHANGED
@@ -8,10 +8,11 @@ module Sarawong
|
|
8
8
|
def self.header(title = 'title here')
|
9
9
|
string = Builder.header(title)
|
10
10
|
string = string.html_safe
|
11
|
+
return string
|
11
12
|
end
|
12
13
|
def self.form(input)
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
string = Builder.form(input, input.column_names)
|
15
|
+
string = string.html_safe
|
16
|
+
return string
|
16
17
|
end
|
17
18
|
end
|