public
Clone URL: git://github.com/defunkt/exception_logger.git
Fixed view error
Jason Knight (author)
Thu May 15 10:17:11 -0700 2008
commit  a65c036f338a8089c5414b845e04c1124b4ac520
tree    710fd12e0bc6d2110d013f4100d849986fb7fec0
parent  ad12a2b3e39847c3e543f6a98cc22b504c8a3671
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
 
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,96 +1 @@
0
-require File.dirname(__FILE__) + '/../../../config/environment'
0
 puts IO.read(File.join(File.dirname(__FILE__), 'README'))
0
-puts "\n\nAltering ApplicationController, this can be undone by editing that file..."
0
-#install alter the app controller
0
-app_controller = File.readlines(RAILS_ROOT + '/app/controllers/application.rb')
0
-i = 0
0
-new_app_controller = ''
0
-app_controller.each do |line|
0
- if line.include? 'class ApplicationController' then
0
- i = i + 1
0
- app_controller[i] = "\s\sinclude ExceptionLoggable #Automatically Added by install script\n" + app_controller[i]
0
- end
0
- i = i + 1
0
- new_app_controller << line
0
-end
0
-app_controller_target = File.open(RAILS_ROOT + '/app/controllers/application.rb','w')
0
-app_controller_target.write(new_app_controller)
0
-app_controller_target.close
0
-#app controller alter done
0
-puts ".....Completed.\n"
0
-puts "Altering routes.rb, this can be undone by editing that file..."
0
-#modify the routes
0
-routes = File.readlines(RAILS_ROOT + '/config/routes.rb')
0
-i = 0
0
-new_routes = ''
0
-routes.each do |line|
0
- if line.include? 'ActionController::Routing::Routes.draw' then
0
- i = i + 1
0
- routes[i] = "map.connect \"logged_exceptions/:action/:id\", :controller => \"logged_exceptions\" #Automatically Added by install script\n" + routes[i]
0
- end
0
- i = i + 1
0
- new_routes << line
0
-end
0
-routes_target = File.open(RAILS_ROOT + '/config/routes.rb','w')
0
-routes_target.write(new_routes)
0
-routes_target.close
0
-#altered routes file
0
-puts ".....Completed.\n"
0
-puts "Attempting to determine your pagination plugin..."
0
-@pagination = 'none'
0
-Dir.foreach(RAILS_ROOT + '/vendor/plugins') do |file|
0
- if file.strip == 'will_paginate' then
0
- @pagination = 'will_paginate'
0
- elsif file.strip == 'paginating_find' then
0
- @pagination = 'paginating_find'
0
- end
0
-end
0
-puts @pagination
0
-if @pagination == 'will_paginate' then
0
- puts "You are using will_paginate, editing init.rb to reflect that..."
0
- #set it to will_paginate
0
- init_rb = File.readlines(File.join(File.dirname(__FILE__), 'init.rb'))
0
- i = 0
0
- new_init = ''
0
- init_rb.each do |line|
0
- if line.include? "$PAGINATION_TYPE = 'none'"
0
- line = '#' + line
0
- j = i + 1
0
- init_rb[j] = init_rb[j].gsub('#','')
0
- j = j + 1
0
- init_rb[j] = init_rb[j].gsub('#','')
0
- j = j + 1
0
- init_rb[j] = init_rb[j].gsub('#','')
0
- end
0
- i = i + 1
0
- new_init << line
0
- end
0
- target = File.open(File.join(File.dirname(__FILE__), 'init.rb'),'w')
0
- target.write(new_init)
0
- target.close
0
-elsif @pagination == 'paginating_find' then
0
- puts "You are using paginating_find, editing init.rb to reflect that..."
0
- #set it to paginating_find
0
- init_rb = File.readlines(File.join(File.dirname(__FILE__), 'init.rb'))
0
- i = 0
0
- new_init = ''
0
- init_rb.each do |line|
0
- if line.include? "$PAGINATION_TYPE = 'none'"
0
- line = '#' + line
0
- j = i + 4
0
- init_rb[j] = init_rb[j].gsub('#','')
0
- j = j + 1
0
- init_rb[j] = init_rb[j].gsub('#','')
0
- end
0
- i = i + 1
0
- new_init << line
0
- end
0
- target = File.open(File.join(File.dirname(__FILE__), 'init.rb'),'w')
0
- target.write(new_init)
0
- target.close
0
-else
0
- puts "Could not detect a pagination plugin, using home brewed pagination instead..."
0
-end
0
-#generate migration
0
-puts "...Completed\n"
0
-puts "Now use script/generate exception_migration\n Then run rake db:migrate\n\n"
...
1
2
3
4
5
6
 
7
8
9
...
48
49
50
51
52
53
 
54
55
 
56
57
58
...
1
2
3
 
 
 
4
5
6
7
...
46
47
48
 
49
 
50
51
 
52
53
54
55
0
@@ -1,9 +1,7 @@
0
 <div id="exceptions">
0
 <div class="pages">
0
   <%= link_to_remote 'Delete Visible', :url => { :action => 'destroy_all' }, :with => "ExceptionLogger.deleteAll()" %>
0
-<% if @exceptions.total_pages > 1 %>
0
-:: Pages: <strong><%= pagination_remote_links @exceptions %></strong>
0
-<% end %>
0
+<%= pagination_remote_links @exceptions %>
0
 </div>
0
 
0
 <h1>Exceptions <%= "<span>(filtered)</span>" if filtered? %> </h1>
0
@@ -48,11 +46,10 @@ if Date.today == exc.created_at.to_date
0
 
0
 </table>
0
 
0
-<% if @exceptions.total_pages > 1 %>
0
 <div class="pages pages-bottom">
0
-Pages: <strong><%= pagination_remote_links @exceptions %></strong>
0
+<%= pagination_remote_links @exceptions %>
0
 </div>
0
-<% end %>
0
+
0
 
0
 
0
 </div> <!-- #exceptions -->

Comments

    No one has commented yet.