Pregunta

I recently upgraded my code from Rails 3.x to Rails 4. Everything worked in Rails 3.x However, I now notice that my app no longer posts the no-name attribute parameters when I hit submit. The app is supposed to use Braintree.js (payment gateway script) to encrypt the no-name params just before posting. Any thoughts? Could this be connected with strong parameters in Rails 4? How can I fix it? Thanks.

¿Fue útil?

Solución

Rails 4 ships with the Turbolinks gem. This gem uses Ajax to speed up page rendering in most applications. It is automatically included when you create a Rails 4 app. The problem was that Turbolinks and Braintree.js were not playing nice. As a result, Braintree.js was not executing and so the encrypted credit card information could not be posted along with the other model bound parameters. I disabled Turbolinks (via gemfile and application.js), and Braintree is back to functioning normally.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top