Reputation: 1464
Hello guys I have this video tutorial on Ruby on Rails and I see that the guy has a bottom script debug, in the browser window. The problem is, I have only one part of that video tutorial (that part is free) and he says nothing about that debug. Maybe you guys can figure it out.
Here's a screenshot with it: http://i55.tinypic.com/3537drp.png
How can I achieve that? Thanks.
Upvotes: 8
Views: 2928
Reputation: 1
for debugging the view you can simply <% debugger %> in your view page wherever your want to see the dataflow and load that view again and on the console you can run each line of view and see the data flow.. and make sure you have debugger gem in your gem file.
Upvotes: 0
Reputation: 6371
The Rails Footnotes gem is very easy to configure and includes information like:
Check it out:
https://github.com/josevalim/rails-footnotes
Upvotes: 1
Reputation: 29930
you should maybe consider running rails with the --debugger flag as exemplified in this guide: http://guides.rubyonrails.org/debugging_rails_applications.html
Upvotes: 0
Reputation: 5357
In the view, doing something like
<%= debug params %>
will achieve what you have shown. Using the debug helper you can basically get a yaml dump of any variable that's available to the view, it will also "prettyfy" the dump by formatting it in a <pre> block and using a different background color. From the looks of what he has, he might have added that to the bottom of a layout (might be in app/views/layouts/application.html.erb). That will give you that dump in any of your pages.
Upvotes: 9