I have a CoffeeScript file called subscribers.coffee.erb
$(document).ready ->
stripe = require('stripe')('<%= Rails.configuration.stripe[:publishable_key]%>')
$('.pricing-get-started').prop("disabled", true)
$('.verify-coupon').click ->
# use stripe api to verify that the coupon is valid
return
return
The second line does not seem to be working. I have even tried to copy and past my publishable key but that doesn't work either. I think the following problems are:
require('stripe')isn't found- Rails cannot locate the publishable key from the coffeescript file
Note:
I have a working key. I can sign up for subscriptions and everything from my subscribers/new.html.haml.
I am using gem 'stripe'
Any advice would be greatly appreciated!
requireisn't working or thatrequirecan't find Stripe?gem stripeand from the looks of it, it seems that thestripe.jsfile should be available in the asset pipeline. That is why I thoughtrequiremight be working and there was an issue with rails finding thepublishable_keyRails.configuration.stripe[:publishable_key]is right when you're compiling assets?