Here''s another one I sent that didn''t show up yesterday. Not being a very sophisticated programmer, I frequently use puts for debugging. Only in rails this doesn''t work. What''s the easiest way to do this? It would be nice if there were some sort of debug method that would stick any text I sent to it at the bottom of the layout or something. Thanks, Carl
<%= debug @myobj %> Also have a look at breakpointing once you feel like steppin'' it up a notch (or debug() just isn''t enough).. j On Fri, 11 Feb 2005 09:42:00 -0800, Carl Youngblood <carlwork-0CEYHQKyN7s@public.gmane.org> wrote:> Here''s another one I sent that didn''t show up yesterday. > > Not being a very sophisticated programmer, I frequently use puts for > debugging. Only in rails this doesn''t work. What''s the easiest way to > do this? It would be nice if there were some sort of debug method that > would stick any text I sent to it at the bottom of the layout or something. > > Thanks, > Carl > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Johan Sørensen Professional Futurist www.johansorensen.com
Brandon Philips
2005-Feb-11 17:46 UTC
Re: [newbie] Easiest way to output debug information
This wiki page may help you: http://wiki.rubyonrails.com/rails/show/HowtoDebugWithBreakpoint -bp On 09:42 Fri 11 Feb , Carl Youngblood wrote:> Here''s another one I sent that didn''t show up yesterday. > > Not being a very sophisticated programmer, I frequently use puts for > debugging. Only in rails this doesn''t work. What''s the easiest way to > do this? It would be nice if there were some sort of debug method that > would stick any text I sent to it at the bottom of the layout or something. > > Thanks, > Carl > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-- Brandon Philips brandon-CJG/fkoVOTIdnm+yROfE0A@public.gmane.org "Open minds. Open doors. Open source." - osuosl.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Carl Youngblood
2005-Feb-11 18:57 UTC
Re: [newbie] Easiest way to output debug information
Johan Sörensen wrote:><%= debug @myobj %> > >Also have a look at breakpointing once you feel like steppin'' it up a >notch (or debug() just isn''t enough).. > >j >Thanks. This is okay, but it still takes extra steps to cause the debug info to be put into a variable at the point in the code where I want to capture the information and then display that variable later on when the view is rendered. I''m sure breakpointing would improve things too. It would be cool if there was some method that when called, added debug info to some sort of global or widely-visible variable, and the rendering engine checked this variable to see if it had anything in it, and automatically appended that to your output. I''m sure as I use rails it will become easier for me suit it more to my needs, but right now I''m still trying to understand it and use it the way it was intended to be used. Carl
Carl Youngblood
2005-Feb-11 19:20 UTC
Re: [newbie] Easiest way to output debug information
Johan Sörensen wrote:> <%= debug @myobj %> > > Also have a look at breakpointing once you feel like steppin'' it up a > notch (or debug() just isn''t enough).. > > j >Thanks. This is okay, but it still takes extra steps to cause the debug info to be put into a variable at the point in the code where I want to capture the information and then display that variable later on when the view is rendered. I''m sure breakpointing would improve things too. It would be cool if there was some method that when called, added debug info to some sort of global or widely-visible variable, and the rendering engine checked this variable to see if it had anything in it, and automatically appended that to your output. I''m sure as I use rails it will become easier for me suit it more to my needs, but right now I''m still trying to understand it and use it the way it was intended to be used. Carl
Carl Youngblood wrote:> It would be cool if there was some method that when called, added debug > info to some sort of global or widely-visible variable, and the > rendering engine checked this variable to see if it had anything in it, > and automatically appended that to your outputAll controller and model instances have a logger available: logger.info ''hello world'' tail -f log/development.log to watch your dev site or tail -f log/test.log to watch your unit tests. jeremy
Demetrius Nunes
2005-Feb-11 19:47 UTC
Re: [newbie] Easiest way to output debug information
Carl Youngblood wrote:> Here''s another one I sent that didn''t show up yesterday. > > Not being a very sophisticated programmer, I frequently use puts for > debugging. Only in rails this doesn''t work. What''s the easiest way > to do this? It would be nice if there were some sort of debug method > that would stick any text I sent to it at the bottom of the layout or > something.Hi Carl, puts doesn''t work on Rails because it affects the STDOUT and that is used by Rails to output the http responses to the browser. The politically correct way to do this kind of debugging would be to use Rails loggers that are available on all models and controllers and tail your .log files. But if you are running webrick on a console window and just want a quick peek at some debug data, use STDERR.puts or $stderr.puts and you should be fine. Just remeber to remove those when you''re done debugging. Rgds, Dema
I''m having problems with the upgrade to 0.10.0 I get the following error on all my applications NoMethodError in Heatmap#display Showing /heatmap/display.rhtml where line #11 raised undefined method `each_with_index'' for nil:NilClass 8: <body><font size = "2"> 9: <table border="2"> 10: <tr> 11: <% @arr.each_with_index do |h, i| %> I''ve followed the instructions on upgrading at http://manuals.rubyonrails.com/read/book/15 Any ideas what I''m doing wrong.
On Sun, 27 Feb 2005 09:30:52 +1100, David van den Berg <dvdberg-ee4meeAH724@public.gmane.org> wrote:> I''m having problems with the upgrade to 0.10.0 > > I get the following error on all my applications > > NoMethodError in Heatmap#display > > Showing /heatmap/display.rhtml where line #11 raised undefined method > `each_with_index'' for nil:NilClassThis indicates that @arr is nil, have you accidentally commented out the section of the controller that prepares it?> 8: <body><font size = "2"> > 9: <table border="2"> > 10: <tr> > 11: <% @arr.each_with_index do |h, i| %> > > I''ve followed the instructions on upgrading at > http://manuals.rubyonrails.com/read/book/15 > > Any ideas what I''m doing wrong. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz