poke_js 0.1.5 → 0.1.6

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.
@@ -53,7 +53,7 @@ POKE = {
53
53
  },
54
54
  init: function() {
55
55
  var $body = $('body');
56
- POKE.exec_all($body.data("controller"), "html", $body.data("action"));
56
+ POKE.exec_all(POKE.controller, "html", POKE.action);
57
57
  }
58
58
  };
59
59
 
@@ -1,5 +1,6 @@
1
1
  (function() {
2
2
  <% controller, action = poke_js_template %>
3
+ POKE.define('POKE', { controller: "<%=controller%>", action: "<%=action%>", method: "<%=request.method%>", path: "<%=request.env['PATH_INFO']%>" });
3
4
  APP.<%= controller.gsub("/", ".") %>.js.<%= action %>_params = <%= yield %>;
4
5
  POKE.exec_all('<%= poke_js_template[0] %>', 'js', '<%= poke_js_template[1] %>');
5
6
  })();
@@ -1,3 +1,3 @@
1
1
  module PokeJs
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -26,10 +26,10 @@ module PokeJs
26
26
  if format == :html
27
27
  with_format(:js) do
28
28
  if lookup_context.template_exists? "#{controller}/#{action}_params"
29
+ #defined in application.js.erb
30
+ poke_string = %Q/POKE.define('POKE', { controller: "#{controller}", action: "#{action}", method: "#{request.method}", path: "#{request.env['PATH_INFO']}" });/
29
31
  javascript_tag do
30
- raw %Q/
31
- APP.#{controller.gsub("/", ".")}.html.#{action}_params = #{ render :template => "#{controller}/#{action}_params" };
32
- /
32
+ raw %Q/APP.#{controller.gsub("/", ".")}.html.#{action}_params = #{ render :template => "#{controller}/#{action}_params" };#{poke_string}/
33
33
  end
34
34
  end
35
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poke_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-10 00:00:00.000000000 Z
12
+ date: 2013-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails