x-editable-rails 1.2.1 → 1.2.2
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: f6fdf15b9dba5e939debe9387b5a18fbf5303249
|
4
|
+
data.tar.gz: 5a05eb8fc0b7217d406745d0e9bb7675f713428a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e748ea5acba0ede342cba31f235e8635eda1793a5243859c8367d2e2ce4536cecf2ad75e70d707592121a4070b50508679a0e73ca99ffa8f4b9d62df16e870ef
|
7
|
+
data.tar.gz: 46ed0d36e34c70202979fac240806f5703b74e6c368229c469ca858d335eb16d2afa856e23e4d522286bacb953249029da8f230d8c4d43772587f3567f5ad4a0
|
data/README.md
CHANGED
@@ -49,19 +49,19 @@ end
|
|
49
49
|
and this is how to use helper method
|
50
50
|
|
51
51
|
```ruby
|
52
|
-
%h1= editable @page,
|
52
|
+
%h1= editable @page, :name, e: @page.name
|
53
53
|
# editable object, what_you_want_update, e: exception - when is xeditable? false or can? :edit, object is false
|
54
54
|
```
|
55
55
|
|
56
56
|
or with nested attributes (globalize3 example)
|
57
57
|
```ruby
|
58
|
-
%h1= editable @page,
|
58
|
+
%h1= editable @page, :name, nested: :translations, nid: @page.translation.id, e: @page.name
|
59
59
|
# nested: nested attributes, nid: id of nested attribute
|
60
60
|
```
|
61
61
|
|
62
62
|
Example of nested resource
|
63
63
|
```ruby
|
64
|
-
%h1= editable [picture.gallery, picture],
|
64
|
+
%h1= editable [picture.gallery, picture], :name, nested: :translations, nid: picture.translation.id, e: picture.name
|
65
65
|
```
|
66
66
|
|
67
67
|
You can also update everything directly.
|
@@ -9,7 +9,7 @@ module X
|
|
9
9
|
model = object.class.to_s.downcase
|
10
10
|
model_param = model.gsub('::', '_')
|
11
11
|
model_name = model.gsub('::', '/')
|
12
|
-
klass = options[:nested] ? object.class.const_get(options[:nested].singularize.capitalize) : object.class
|
12
|
+
klass = options[:nested] ? object.class.const_get(options[:nested].to_s.singularize.capitalize) : object.class
|
13
13
|
content_tag :a, href: "#", class: "editable",
|
14
14
|
data: {
|
15
15
|
type: 'text',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: x-editable-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jiri Kolarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|