What's the optimal way to deal with non-existent variables in Rails? -


I am working on the railway app that pulls data from group API and displays them on our site. For example:

 --- - "id": An "option" deal: "redemption location": - "street address 1": 123 no street "-" id " : Deal two "options": []  

If I wanted a loop through every transaction, and to display the street 1 if it exists, then what is the optimal way to do this in the railways?

just do it:

  if (defined? StreetAddress1) then print Street Edder 1 + "is set" end   

Hope this helps

Comments