actionview-helpers-auto_tag_helper 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea5ed3f6bda855fc5c91368fb0cb0eeb1c2f67b
|
4
|
+
data.tar.gz: 401f7b396a52a341582dd9f1d0da0127acf463cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 051d6ec33894d2b7cb4485a89a05d524b26fc8bf01e5cb6a012ada7b3e6d3f3f055356cfb53c99d7737a529b01c187ebd1bd0e15f3c6c25860fe0e4c43de6a2f
|
7
|
+
data.tar.gz: 4c8df17ed2df77eeaad904aa3ce19cd359ab272cd7894c1bcbab59365f458cf6c49d7c9cad2e06b99c3894bea3e9ea9d60d7ae184470b79ac483b4a7bcb6e212
|
@@ -17,16 +17,14 @@ module ActionView
|
|
17
17
|
# html options , ex: {style: "width: 100px; height: 100px; color: #ff0000;" placeholder: 'your name'}
|
18
18
|
#
|
19
19
|
def display_tag(method_name,rec,html_options={})
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
# end
|
27
|
-
# end
|
20
|
+
rec.class.try(:reflections).try(:each) do |reflname,refl|
|
21
|
+
if refl.foreign_key.to_sym == method_name.to_sym && refl.macro == :belongs_to
|
22
|
+
method_name = reflname
|
23
|
+
break
|
24
|
+
end
|
25
|
+
end
|
28
26
|
v = rec.__send__(method_name)
|
29
|
-
display_tag_with_display_options(v,rec,method_name,html_options) ||
|
27
|
+
display_tag_with_display_options(v,rec,method_name,html_options) || v.try(:__display__) || v.to_s
|
30
28
|
end
|
31
29
|
|
32
30
|
def display_tag_with_display_options(v,rec,method_name,html_options={})
|
@@ -66,7 +64,7 @@ module ActionView
|
|
66
64
|
def auto_input_tag(sym,model,name,value)
|
67
65
|
column = model.columns_hash[sym.to_s]
|
68
66
|
type = column.type
|
69
|
-
opts = model.
|
67
|
+
opts = model.try(:input_options,sym) || {}
|
70
68
|
reference_tag(sym,model,name,value) || boolean_tag(type,name,value) || datetime_tag(type,name,value,opts) || number_tag(type,name,value,opts) || text_tag(type,name,value,opts)
|
71
69
|
end
|
72
70
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionview-helpers-auto_tag_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinjiro Itagaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|