dynaspan 0.0.9 → 0.1.0
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: fe015e308bc55699d068d01a096f8e2f4964e2db
|
4
|
+
data.tar.gz: 369852add27511b776be766f4a132bfeaa6ff573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 167c0cc24f7a2425dc2b8162759d1137fc5e576679ccd3bc77f4c101c79f16931f6dd05683197f27714038649380196e30ba2684b0289438ec81a7f19080df18
|
7
|
+
data.tar.gz: a028f7e1b474d89d22331684b2b907137f753487f358d888dc83e95f005a66f9cd6ae1e5927d28e3eb4e5fc0c087662dfa424fcb4e9492f4c7600aa6fd5d4ae5
|
data/README.md
CHANGED
@@ -16,16 +16,21 @@ Dynaspan also accepts updating an attribute for a nested object, but only 1 leve
|
|
16
16
|
|
17
17
|
###Usage
|
18
18
|
|
19
|
-
Example:
|
19
|
+
Example #1:
|
20
20
|
|
21
21
|
dynaspan_text_field(@article, comment, :note, '[edit]')
|
22
|
+
|
23
|
+
Example #2:
|
24
|
+
|
25
|
+
dynaspan_text_field(profile, profile.websites, :url, '[edit]',
|
26
|
+
{hidden_field: {page_name: 'page2'}, callback_on_update: "alert('Awesome!');"})
|
22
27
|
|
23
28
|
This will show the value of note in the comment object as plain text. It can be clicked on to instantly become a text field input. And once unselected the `@article` object will update with its nested attribute object `comment` and its new value in the `note` attribute.
|
24
29
|
|
25
30
|
You can use either `dynaspan_text_field` or `dynaspan_text_area` in any of your views. There are two mandatory parameters. The first is a the main Object model instance you will be updating. And the other mandatory field is the symbol of the attribute to update. There are two optional fields. The first is the nested attribute object which will have its field updated. And the last is the optional text for `[edit]`-ing (clicking on to edit which is useful for blank fields).
|
26
31
|
|
27
|
-
dynaspan_text_field(Object,OptionalNestedObject,SymField,OptionalEditText)
|
28
|
-
dynaspan_text_area(Object,OptionalNestedObject,SymField,OptionalEditText)
|
32
|
+
dynaspan_text_field(Object,OptionalNestedObject,SymField,OptionalEditText,OptionalOptionsHash)
|
33
|
+
dynaspan_text_area(Object,OptionalNestedObject,SymField,OptionalEditText,OptionalOptionsHash)
|
29
34
|
|
30
35
|
The order is important. And yes it does NOT change even if you just do:
|
31
36
|
|
@@ -68,6 +73,10 @@ calling parents with selectors. Example usage:
|
|
68
73
|
|
69
74
|
###What's New
|
70
75
|
|
76
|
+
####Version 0.1.0
|
77
|
+
|
78
|
+
Added the same hidden_fields from version 0.0.8 to support non-nested Objects. You can use them now on anything.
|
79
|
+
|
71
80
|
####Version 0.0.9
|
72
81
|
|
73
82
|
JavaScript callback option now available. Whenever the Dynaspan field is submitted you can have Dynaspan call
|
@@ -88,6 +97,8 @@ valid options only include:
|
|
88
97
|
|
89
98
|
You can add as many hidden fields to your Dynaspan objects as you'd like.
|
90
99
|
|
100
|
+
>NOTE: In this version hidden fields only apply for nested attributes.
|
101
|
+
|
91
102
|
Also the id parameter will only be passed to the server if it exists. (No more empty
|
92
103
|
string for id.) This allows you to create "new" polymorphic child objects with Dynaspan.
|
93
104
|
|
@@ -13,6 +13,9 @@
|
|
13
13
|
<% end %>
|
14
14
|
<% else %>
|
15
15
|
<%= f.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control dyna-span-input', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
16
|
+
<% hidden_fields.each do |hkey, hval| %>
|
17
|
+
<%= f.hidden_field hkey.to_sym, value: hval %>
|
18
|
+
<% end if hidden_fields %>
|
16
19
|
<% end %>
|
17
20
|
<% end %>
|
18
21
|
</div>
|
@@ -13,6 +13,9 @@
|
|
13
13
|
<% end %>
|
14
14
|
<% else %>
|
15
15
|
<%= f.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control dyna-span-input', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
16
|
+
<% hidden_fields.each do |hkey, hval| %>
|
17
|
+
<%= f.hidden_field hkey.to_sym, value: hval %>
|
18
|
+
<% end if hidden_fields %>
|
16
19
|
<% end %>
|
17
20
|
<% end %>
|
18
21
|
</div>
|
data/lib/dynaspan/version.rb
CHANGED