This is my code. What I want to do is only show STAXCODE if the state is in this list. AL,FL,CO
<% @ship_states.each do |state| %>
<%= state.STAXCODE %>
<% end %>
try,
<% @ship_states.each do |state| %>
<%= ['AL', 'FL', 'CO'].include?(state.STAXCODE) ? state.STAXCODE : nil %>
<% end %>
state.STAXCODE.strip should get rid of those spaces for you