foundation_rails_helper_mod 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWQ0ZjQxZTIzYmNjNzAxYmViODI5MDhmYzRiOWUxMDk0MzBhNDZjNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWFiYjQ0ZWZlMTBhNGE4NjgxNWQ0MjI3ZTQ2NjMxNzBjNzA2YWFiNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjlhZDJhZDdiZWNiNzJhNmQ3OWI4MTQ2NzAyNTBmZGY2ZjdiNTJhODhhMDhk
|
10
|
+
NDBlMTE5MzY1MzZmMjAyNjU1NzZlZjQ5NzI2OTI0NzE3ZDg3NDE1NTljMDJk
|
11
|
+
NjkyYWI0ODUxYzgyMTQ0Y2RiMTI2Y2Y2OGZiMTc5NDM2NmI2ZmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjQ3ZGQ4YjZlNGMwYWYyZTY3ODRhMjJjYzNhMDU1MjI0YjYwMWMwMWFjODhk
|
14
|
+
MjRhN2IyODJjYjZmMmE5MGM5OTgyYmZkMGI2MmI0NWM5NTdmYWQ0MmUyYTE3
|
15
|
+
MTU4OWI3YzgwZDllOWVhYTlkN2FmMjYwMTkzZWM0NTI5ZDJmNmY=
|
@@ -3,7 +3,8 @@ require 'action_view/helpers'
|
|
3
3
|
module FoundationRailsHelperMod
|
4
4
|
class FormBuilder < ActionView::Helpers::FormBuilder
|
5
5
|
include ActionView::Helpers::TagHelper
|
6
|
-
|
6
|
+
|
7
|
+
%w(file_field email_field text_field text_area telephone_field phone_field url_field number_field).each do |method_name|
|
7
8
|
define_method(method_name) do |*args|
|
8
9
|
attribute = args[0]
|
9
10
|
options = args[1] || {}
|
@@ -13,22 +14,6 @@ module FoundationRailsHelperMod
|
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
def text_field(attribute, options = {})
|
17
|
-
html = ''.html_safe
|
18
|
-
|
19
|
-
if options[:label].present?
|
20
|
-
html = custom_label(attribute, options[:label], options[:label_options]) do
|
21
|
-
options.delete(:label)
|
22
|
-
options.delete(:label_options)
|
23
|
-
super(attribute, options)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
html += content_tag(:p, options[:description], :class => 'description') if options[:description].present?
|
28
|
-
html += error_and_hint(attribute, options)
|
29
|
-
html += Tags::TextField.new(object_name, method, self, options).render
|
30
|
-
end
|
31
|
-
|
32
17
|
def check_box(attribute, options = {})
|
33
18
|
html = custom_label(attribute, options[:label], options[:label_options]) do
|
34
19
|
options.delete(:label)
|