On 2013-Nov-20, at 17:07 , yinwen Xuan <lists / ruby-forum.com> wrote:

> HI thanks again Wayne!
>=20
> I did tried
> <% puts "Work: #{@user.phone_work}" if !@user.phone_work.nil? -%>
>=20
> still the same, not showing at all no matter nil or not.
>=20
> this field is for phone number.

Let me guess that you're actually talking about a Ruby *on Rails* =
application and don't realize that there is a separate =
mailing-list/forum for Rails questions.

If so, then you have ActiveSupport and the perfect method for this test:

@user.phone_work.blank? (or its opposite @user.phone_work.present?)

<% if @user.phone_work.present? -%>
  Work: <%=3D @user.phone_work %>
<% end -%>

-Rob