Is there any debug toolbar for Rails 3.x

2020-02-26 07:22发布

问题:

I used Rack::Bug more than one year ago, now I'd like to use it with a new Rails 3.1 project. I tried to install it, both the master and rails3 branches, but with no luck.

Also tried some github forks but they did not work either.

Is there any alternative with the same features?

P.S. I already know newrelic and its developer mode, just looking for something else, more similar to Rack::Bug

Here is a little screen shoot of what is capable of (the green toolbar with debugging informations)

回答1:

Rack bug seems to e fixed, rails3 branch works for me on 3.1.1



回答2:

Just found rails-footnotes

Pro:

  • Easy to add
  • Embed TextMate links in your html to quick edit a file
  • Has a trace link near SQL queries that says WHERE the query is executed

Cons:

  • Bad layout, you need to scroll to the bottom of the page, I prefer a toolbar like Rack::Bug
  • Cannot be toggled, always executed
  • Missing ActiveRecord instantiation informations. Very useful when looking for memory leaks.
  • Query trace function always include queries like SHOW FIELDS FROM table SCHEMA and SHOW TABLES
  • Lot of useless informations in the assigns tab such as the whole @_response_body and the @_view_renderer object (which include a lot of informations)

Still looking for else, any hint is appreciated.



回答3:

Check out mini profiler, it's the same one used on StackExchange (except ported to Ruby). http://railscasts.com/episodes/368-miniprofiler?view=asciicast