js_routes 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/js_routes/railtie.rb +9 -9
- data/lib/js_routes/version.rb +1 -1
- metadata +1 -1
data/lib/js_routes/railtie.rb
CHANGED
@@ -32,16 +32,16 @@ module JsRoutes
|
|
32
32
|
Rails.application.routes.routes.each do |route|
|
33
33
|
defaults = route.defaults
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
unless defaults.present? && defaults.has?(:exclude_from_js) && defaults[:exclude_from_js]
|
36
|
+
f << <<-JS.strip
|
37
|
+
Routes.#{route.name}_path = function() {
|
38
|
+
Array.prototype.unshift.call(arguments, '#{route.path}');
|
39
|
+
return $.buildPath.apply($, arguments);
|
40
|
+
};
|
41
|
+
JS
|
42
|
+
end
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
end
|
47
|
+
end
|
data/lib/js_routes/version.rb
CHANGED