Thanks Mark.
I guess it will take some time getting used to having method names as
"value".
-=- Neeraj
On 11/5/05, Mark Reginald James
<mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org>
wrote:>
> Neeraj Kumar wrote:
> > Please refer to
> >
> >
>
http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_view/helpers/date_helper.rb#L261
> >
> > #1
> > I was wondering where is "value" populated here in line 261?
>
>
>
http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_view/helpers/form_helper.rb#L246
>
> > #2
> > Could someone explain to me the syntax used here.? What does this mean
> > something = (value || 0)
>
> It''s a normal lazy-evaluating OR, which has the effect of setting
> something to value if value is true, and to 0 if value is false
> (i.e. false, nil, or un-set). Same as: "something = value ? value :
0"
>
> --
> We develop, watch us RoR, in numbers too big to ignore.
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails