Hey, love the new Stripe video but I'm stuck on something.
I am getting the error: uninitialized constant ActionView::CompiledTemplates::STRIPE_PUBLIC. It's having a problem with my meta tag which I placed on the application.html.erb
I have this in my JS file:
$ Stripe.setPublishableKey( $("meta[name='stripe-key']").attr("content"))
And then this in my application.html.erb file:
<%= tag :meta, name: "stripe-key", content: STRIPE_PUBLIC %>
And then at the bottom of my development.rb file I have
STRIPE_SECRET = "xxxxxxxxxxxxxxxxxxxxxxx"
STRIPE_PUBLIC = "xxxxxxxxxxxxxxxxxxxxxxx"
Any idea why I might be getting this error?
It sounds like you've got everything but may just need to restart your rails server to pickup the constant in the config file. Have you tried that?
Always the easy things! 😉
Last night I got tripped up on making a pluralization mistake for like 45 minutes. :)
Join 29,763+ developers who get early access to new screencasts, articles, guides, updates, and more.