So this has to do with an order form. If the user does enter data (in this case, a company, a phone#, an address)…then it puts it in the email template and shows it in list format. If not, nothing shows up, BUT we don’t want the list bullet to be blank either!
Is ternary even the best way to go here?
Swear I had this figured out last week but drawing a blank.
%h3{ :style => "font-size: 14px; color: #848687; font-weight: bold;" } Shipping Details
%ul
%li{ :style => "font-size: 13px; color: #848687;" }= [@bulk_order.shipping_company].empty? ? "" :
%li{ :style => "font-size: 13px; color: #848687;" }= "Company: #{@bulk_order.shipping_company}"
%li{ :style => "font-size: 13px; color: #848687;" }= "Phone: #{@bulk_order.shipping_phone}"
%li{ :style => "font-size: 13px; color: #848687;" }= "Address: #{@bulk_order.shipping_address}, #{@bulk_order.shipping_city}, #{@bulk_order.shipping_state}, #{@bulk_order.shipping_zip}"
Any help is greatly appreciated!
Your statement is incomplete:
[@bulk_order.shipping_company].empty? ? "" :It should be something like :
[@bulk_order.shipping_company].empty? ? "" : @bulk_order.shipping_company