here's the basic sketch... but seems to work fine in rails 4.1.7
will check with original env