Hi there , I found the specific bug in my code. Truly saying I still did not find the bug . so I am writing now. I am looping through database records in my view <% for blue_widget in @blue_widgets %> <% if blue_widget.B == 1 and blue_widget.B == 1 %> ..some code <% if blue_widget.a == 0 and blue.widget == 1 %> ...come code for second condition <% end %> <% else %> ..code for rest cases <% end %> <% end %> The question in way all of records do the ELSE condition despite of fact they should do the first or second IF ? Is the problem that I can not loop through the arrays in this way? Best regards , Pg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2007/9/17, pgega <gega.pawel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Hi there , > > I found the specific bug in my code. Truly saying I still did not find > the bug . so I am writing now. >Try to use the DebugHelper(http://api.rubyonrails.org/classes/ActionView/Helpers/DebugHelper.html) in your view to see the values. Maybe you forgot to set something. <code> debug(blue_widget) </code> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Great tool, but I did not forget about anything Considering content output of Debug() , the record should work with following condition <% if blue_widget.B == 1 and blue_widget.B == 1 %> ..some code But works with <% else %> ..code for rest cases Maybe , I did something wrong with if/else conditional statements? On Sep 17, 8:04 am, "Thomas Wieczorek" <wieczo...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2007/9/17, pgega <gega.pa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > Hi there , > > > I found the specific bug in my code. Truly saying I still did not find > > the bug . so I am writing now. > > Try to use the DebugHelper(http://api.rubyonrails.org/classes/ActionView/Helpers/DebugHelper.html) > in your view to see the values. Maybe you forgot to set something. > <code> > debug(blue_widget) > </code>--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Are you sure that the values are actually integers and not strings? Does this fix your problem? blue_widget.B.to_i == 1 and blue_widget.B.to_i == 1 pgega wrote:> Great tool, but I did not forget about anything > > Considering content output of Debug() , the record should work with > following condition > <% if blue_widget.B == 1 and blue_widget.B == 1 %> > ..some code > > But works with > <% else %> > ..code for rest cases > > Maybe , I did something wrong with if/else conditional statements? > > On Sep 17, 8:04 am, "Thomas Wieczorek" <wieczo...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > >> 2007/9/17, pgega <gega.pa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> >> >>> Hi there , >>> >>> I found the specific bug in my code. Truly saying I still did not find >>> the bug . so I am writing now. >>> >> Try to use the DebugHelper(http://api.rubyonrails.org/classes/ActionView/Helpers/DebugHelper.html) >> in your view to see the values. Maybe you forgot to set something. >> <code> >> debug(blue_widget) >> </code> >> > > > > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 17, 2007, at 12:02 AM, pgega wrote:> <% if blue_widget.B == 1 and blue_widget.B == 1 %> > ..some code > <% if blue_widget.a == 0 and blue.widget == 1 %>Are those the actual lines in your code, or typos from preparing your post? The first line is redundant, and the last line refers to a blue object, not a blue_widget. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---