trackman 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
|
|
1
1
|
class <%= controller_name.camelize %>Controller < ApplicationController
|
2
2
|
include Trackman::Scaffold::ContentSaver
|
3
|
-
after_filter :
|
4
|
-
after_filter :render_filters
|
3
|
+
after_filter :render_content if Rails.env.development?
|
5
4
|
|
6
5
|
# ContentSaver defines two class methods for filtering the ouput of your pages
|
7
6
|
#
|
@@ -58,21 +58,12 @@ module Trackman
|
|
58
58
|
xslt.apply_to(html).to_s
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
62
|
-
|
63
|
-
@cache[key] || yield
|
64
|
-
end
|
65
|
-
|
66
|
-
def render_filters
|
67
|
-
response.body = cache(params[:action]) { new_content }
|
68
|
-
end
|
69
|
-
|
70
|
-
def save_filters
|
61
|
+
def render_content
|
62
|
+
response.body = new_content
|
71
63
|
to_write = self.class.mappings[params[:action].to_sym]
|
72
64
|
unless to_write.nil?
|
73
65
|
path = "/public/#{to_write}.html"
|
74
|
-
|
75
|
-
File.open(Rails.root.to_s + path, 'w') { |f| f.write(result) }
|
66
|
+
File.open(Rails.root.to_s + path, 'w') { |f| f.write(response.body) }
|
76
67
|
end
|
77
68
|
end
|
78
69
|
end
|
data/lib/trackman/version.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
class <%= controller_name.camelize %>Controller < ApplicationController
|
2
2
|
include Trackman::Scaffold::ContentSaver
|
3
|
-
after_filter :
|
4
|
-
after_filter :render_filters
|
3
|
+
after_filter :render_content if Rails.env.development?
|
5
4
|
# ContentSaver defines two class methods for filtering the ouput of your pages
|
6
5
|
#
|
7
6
|
# Note that it uses nokogiri to parse the output.
|