Tuesday, December 22, 2009

Re: [Rails] Check empty? of variable for Case/When

2009/12/22 adedip <adedip@gmail.com>:
> I have this:
> -----------
>   case child.name
>         when @collection.location_tag
>           @article.location = child.content
>         when @collection.content_tag
>           @article.content = child.content
>         when @collection.docno_tag
>           @article.docno = child.content
>         when @collection.date_tag
>           temp_date = child.content
>     end
> -----------
>
> is there a way to check whether the @collection.attributes are empty
> or not before to evaluate them in the "When" clause?

I don't understand what you mean, can you be more explicit?

Colin

--

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate