Ruby on Rails Debug Question

Hi guys, I have this Ruby on Rails video tutorial and I see that the guy has the bottom script debug in the browser window. The problem is that I have only one part of this video tutorial (this part is free) and it does not say anything about this debugging. Perhaps you guys can figure it out.

Here is a screenshot with it: http://i55.tinypic.com/3537drp.png

How can I achieve this? Thanks.

+8
debugging ruby-on-rails ruby-on-rails-3
source share
5 answers

In the view, having done something like

<%= debug params %> 

will achieve what you have shown. Using the debugging helper, you can, in principle, get a yaml dump of any variable available for presentation, it will also be a β€œnice” dump, formatting it in <pre> block and use a different background color. From the looks of what he has, he could add this to the bottom of the layout (maybe in app / views / layouts / application.html.erb). This will give you this dump to any of your pages.

+9
source share

The Rails Footnotes environment is very easy to set up and includes information such as:

  • variable assignments
  • params action / controller
  • route information
  • SQL statements and runtime

Check this:

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

+1
source share

Looks like it just outputs params.to_yaml to the page.

0
source share

you should consider running rails with the -debugger flag, as shown in this guide: http://guides.rubyonrails.org/debugging_rails_applications.html

0
source share

To debug a view, you can simply <% debugger%> on your view page, where you want to see the data stream and load this view again and on the console, you can start each view line and see the data stream. and make sure you have a gem debugger in your gem file.

0
source share

Source: https://habr.com/ru/post/649833/


All Articles