Updated version of card_exchange with Ruby on Rails