I used @variable.inspect to print out the contents of the return from Object.find_all, and got something like this: [#"9", "field1"=>"1", "id"=>"1", "field2"=>"5"}>, #"2", "field1"=>"1", "id"=>"2", "field2"=>"6"}>] What are the #"9" and #"2", and why does each element end with }>? What am I looking at here? -- - Adam ----- ** My new project --> http://www.visiognomy.com/daily ** Flagship blog --> http://www.aquick.org/blog Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ] Links: [ http://del.icio.us/fields ] Photos: [ http://www.aquick.org/photoblog ]
Adam Fields wrote:> I used @variable.inspect to print out the contents of the return from > Object.find_all, and got something like this: > > [#"9", "field1"=>"1", "id"=>"1", "field2"=>"5"}>, #"2", "field1"=>"1", "id"=>"2", "field2"=>"6"}>] > > What are the #"9" and #"2", and why does each element end with }>? > > What am I looking at here?Make sure to wrap the actual output of .inspect in <pre> or you will end up missing quite a bit of the output. (As above) Another option is to just use breakpoints where the output of course doesn''t end up in your web browser but rather in a debugging terminal.
On Mon, Feb 28, 2005 at 03:03:28PM +0100, Florian Groß wrote:> >What am I looking at here? > > Make sure to wrap the actual output of .inspect in <pre> or you will end > up missing quite a bit of the output. (As above)oooh. Stupid. Thanks!> Another option is to just use breakpoints where the output of course > doesn''t end up in your web browser but rather in a debugging terminal.-- - Adam ----- ** My new project --> http://www.visiognomy.com/daily ** Flagship blog --> http://www.aquick.org/blog Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ] Links: [ http://del.icio.us/fields ] Photos: [ http://www.aquick.org/photoblog ]
On Sun, 27 Feb 2005 23:30:21 -0500, Adam Fields <rails23049809-CU8A4pfP4hodnm+yROfE0A@public.gmane.org> wrote:> > I used @variable.inspect to print out the contents of the return from > Object.find_allYou can also just try the debug helper. <%= debug @variable %> it''ll pretty print the object it into YAML and wrap it in a <pre> for you. -- Xian