Commit 7dd276817c6459e0fdf6524f1b8e51decd385986
1 parent
9bf7c1ee
Exists in
master
and in
4 other branches
Rack mini profiler for dev env
Showing
3 changed files
with
9 additions
and
0 deletions
Show diff stats
Gemfile
Gemfile.lock
| ... | ... | @@ -237,6 +237,8 @@ GEM |
| 237 | 237 | rack (1.4.1) |
| 238 | 238 | rack-cache (1.2) |
| 239 | 239 | rack (>= 0.4) |
| 240 | + rack-mini-profiler (0.1.9) | |
| 241 | + rack (>= 1.1.3) | |
| 240 | 242 | rack-mount (0.8.3) |
| 241 | 243 | rack (>= 1.0.0) |
| 242 | 244 | rack-protection (1.2.0) |
| ... | ... | @@ -408,6 +410,7 @@ DEPENDENCIES |
| 408 | 410 | omniauth-ldap! |
| 409 | 411 | pry |
| 410 | 412 | pygments.rb! |
| 413 | + rack-mini-profiler | |
| 411 | 414 | rails (= 3.2.5) |
| 412 | 415 | rails-footnotes |
| 413 | 416 | raphael-rails (= 1.5.2) | ... | ... |
app/controllers/application_controller.rb
| ... | ... | @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base |
| 4 | 4 | before_filter :set_current_user_for_mailer |
| 5 | 5 | before_filter :check_token_auth |
| 6 | 6 | before_filter :set_current_user_for_observers |
| 7 | + before_filter :dev_tools if Rails.env == 'development' | |
| 7 | 8 | |
| 8 | 9 | protect_from_forgery |
| 9 | 10 | |
| ... | ... | @@ -142,4 +143,8 @@ class ApplicationController < ActionController::Base |
| 142 | 143 | def render_full_content |
| 143 | 144 | @full_content = true |
| 144 | 145 | end |
| 146 | + | |
| 147 | + def dev_tools | |
| 148 | + Rack::MiniProfiler.authorize_request | |
| 149 | + end | |
| 145 | 150 | end | ... | ... |