Here is a probably an easy output formatting problem.
I am trying to output a sentence that uses commas between each item (retailer) and a period once there are no more items.
The problem is, I can't remove the space before my commas in the output. I've tried putting the html in quotes, but for some reason the html injects a space between my variable output and the following text. How can I solve this?
The second problem is my variable count increments correctly, but it does not trigger the 'else'. Any ideas why?
# the output #
...Write a review on Amazon.com , and GAP , and Limited ,
# the view #
<% for review in @reviews -%> <% count += 1 -%> <%= link_to review.retailer.name, retailer_path(review) -%> <%= if count == @reviews ', ' else ', and ' end -%> <% end %>