x-editable-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/x-editable-rails/version.rb +1 -1
- data/lib/x-editable-rails/view_helpers.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6973ae156c26b7db1083c3215edbbd16c9acae2
|
4
|
+
data.tar.gz: fc3914f001cbaa43658d451ee78ae126fa404e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e76220eafc1289c9c13d1a1a62d74dd639d060b100197759d6529f6101f2000f81e2772d77c8428ea891138cb961008ae44df3bd71ccb2fad347b849c5e3b2d6
|
7
|
+
data.tar.gz: 9a2a5146c291a0603f6aea94299d1a875087722850925ae294ce3aa98d9e3f9cdf59acd908a5ab474c34033adab637ab5023f9e6a3b5939a479323e94cf3e29b
|
@@ -4,9 +4,10 @@ module X
|
|
4
4
|
module ViewHelpers
|
5
5
|
def editable model, object, method, options = {}
|
6
6
|
if can? :edit, model and xeditable?
|
7
|
-
|
7
|
+
model_param = model.to_s.downcase.gsub('::', '_')
|
8
|
+
model_name = model.to_s.downcase.gsub('::', '/')
|
8
9
|
data_url = options[:nested_model] ? polymorphic_path([options[:nested_model], object]) : polymorphic_path(object)
|
9
|
-
content_tag :a, href: "#", class: "editable", data: { type: 'text', model:
|
10
|
+
content_tag :a, href: "#", class: "editable", data: { type: 'text', model: model_param, name: method, url: data_url,
|
10
11
|
nested: (options[:nested] if options[:nested]), nid: (options[:nid] if options[:nid]), 'original-title' => t("activerecord.attributes.#{model_name}#{"/#{options[:nested].singularize}" if options[:nested]}.#{method}") } do
|
11
12
|
object.send(method)
|
12
13
|
end
|
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.0.
|
4
|
+
version: 1.0.1
|
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-07-
|
11
|
+
date: 2013-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|