happy_place 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/happy_place/controller.rb +9 -8
- data/lib/happy_place/railtie.rb +1 -1
- data/lib/happy_place/version.rb +1 -1
- 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: d21a1e55117569cf396c9792253cc152416d2e91
|
4
|
+
data.tar.gz: a2720f9d9a5c7ccf2de5c73f57fead6dfdea5b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46175b9932b189dbdf0b8499dcc7ec9786c4bf13d497ffdff75cf353835d97becc06cd796a809c7de6a8f942c95e8547533b47dc77957aa304bef2b33fb9af18
|
7
|
+
data.tar.gz: 14ffcfb4d171919933ed858bd98e2543c8ac13aae7a952992bcc6fd0a1cdee6d7e5829394c2d7c5b151f714eb05e3259df5876a934a985662506eef0c69b1659
|
@@ -48,12 +48,12 @@ module HappyPlace
|
|
48
48
|
(build_partials_string(partials) + hash_to_js_args(args)).join(", ") +
|
49
49
|
"});"
|
50
50
|
else
|
51
|
-
built_args = "(
|
51
|
+
built_args = "(" + hash_to_js_args(args) + ");"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
def auto_exec_function(class_and_function, args, container)
|
56
|
-
script_string = "<script type='application/javascript'>
|
55
|
+
def auto_exec_function(class_and_function, args, container=nil)
|
56
|
+
script_string = "<script type='application/javascript'>(function(){" + render_to_string(js: class_and_function + args) + "})();</script>"
|
57
57
|
if container.present?
|
58
58
|
script_string = container[:open] + script_string + container[:close]
|
59
59
|
end
|
@@ -61,12 +61,13 @@ module HappyPlace
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def hash_to_js_args(args)
|
64
|
-
js_args = []
|
64
|
+
# js_args = []
|
65
65
|
|
66
|
-
args.each_pair do |k, v|
|
67
|
-
|
68
|
-
end
|
69
|
-
js_args
|
66
|
+
# args.each_pair do |k, v|
|
67
|
+
# js_args << (k.to_s + ": " + "'#{v}'")
|
68
|
+
# end
|
69
|
+
# js_args
|
70
|
+
args.to_json
|
70
71
|
end
|
71
72
|
|
72
73
|
def build_partials_string(partials)
|
data/lib/happy_place/railtie.rb
CHANGED
@@ -4,7 +4,7 @@ module HappyPlace
|
|
4
4
|
class Railtie < Rails::Railtie
|
5
5
|
initializer "your_gem_name.action_controller" do
|
6
6
|
ActiveSupport.on_load(:action_controller) do
|
7
|
-
puts "Extending #{self} with
|
7
|
+
puts "Extending #{self} with HappyPlace::Controller"
|
8
8
|
# ActionController::Base gets a method that allows controllers to include the new behavior
|
9
9
|
include HappyPlace::Controller # ActiveSupport::Concern
|
10
10
|
end
|
data/lib/happy_place/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happy_place
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Piccolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|