Skip to main content
Ask A Question
Notifications
You’re not receiving notifications from this thread.
Subscribe

Stripe Payments

Gems / Libraries • Asked by Corey Holmes

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?
Thanks,


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?


Oh man haha. That always works. Thanks a lot Chris.


Always the easy things! 😉

Last night I got tripped up on making a pluralization mistake for like 45 minutes. :)


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 29,763+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.