tybro0103's Profile

Comments by

Have you considered doing an episode on the rest of Stripe Integration? Things like:
upgrades, downgrades, cancellations, receiving webhooks, updating cc info, handling failed payments, etc.? I've built several subscription sites with authorize.net and these things are always such a pain. I would love find out if there are any best practices and see how other Rails developers handle such things.

@1. I was wondering the same. Values like that are prone to change so it's best to have them in some sort of global variable. I had always used the approach:

Stripe.setPublishableKey('<%= STRIPE_PUBLIC_KEY %>')

I see one advantage to the meta tag version in that you don't have to give your coffeescript file an .erb extension. This can confuse certain text editors. Other than that, I can't figure out why he would have used a meta tag.

Yeah, I'm doing that right now, but it seems like it will become tedious when I have a lot of controllers. Also, how would I define a resource, say "Post", where the controller is at controllers/sites/posts_controller.rb ?

I'm trying to do something similar to the subdomain trick you just showed, but I want to change the controller that's used rather than the view. Is this possible?

I'm making a CMS where a user can create a site and enter their own subdomain. I'd like "/" to point to "public#welcome" if there's no subdomain, but if there is a subdomain, I want it to point to "sites/public#welcome".