Looking for suggestions on following two queries.

Query 1
------------------------------
Are the two following lines of code different in Ruby / Rails ( in a
*.html.erb) file.
<% if @forms.count != 0 %> <!-- first code -->
Vs.
<% if @forms.count %>   <!--second code -->

@forms is an array of objects. Coming from "C" language development
background, i thought they should be the same. FYI, second code
doesn't give any error but still gets evaluated to TRUE. I confirmed
by doing puts @forms.count in controller

Query 2
------------------------
which one is preferred
@forms. count or @forms.size
@forms is an array.

thanks
vipin





--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to