Vlad.P
Vlad.P

Reputation: 1464

Ruby on Rails Debug Question

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

Answers (5)

amrendra singh
amrendra singh

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

port5432
port5432

Reputation: 6371

The Rails Footnotes gem is very easy to configure and includes information like:

  • variable assignments
  • params action / controller
  • route information
  • SQL statements & execution times

Check it out:

https://github.com/josevalim/rails-footnotes

Upvotes: 1

Pedro Rolo
Pedro Rolo

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

Roadmaster
Roadmaster

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

aceofspades
aceofspades

Reputation: 7586

Looks like he's just rendering params.to_yaml onto the page.

Upvotes: 0

Related Questions