Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

Posted in Webpacker error from Vue.js Trello Clone Series

You can get that error if you made a typo because it can't compile the file. Try checking your code for errors.

Posted in New server failed provisioning

This also happens if you used the 512MB server size. It still lists as available even though it is not actually. You can use a 1GB server for the same price and it will work fine too.

Posted in Building A Hosting Platform in Ruby Discussion

Yep, exactly.
Rough outline of how I'd build this:

1. Create a unique referral token for each user
2. Add the link to the UI for the user (link to the homepage with the token) 
<%= link_to root_url(ref: current_user.referral_token), root_url(ref: current_user.referral_token) %>
3. Create a before action on ApplicationController to set the referrer
before_action :set_referrer 
def set_referrer
  # Just store this for later, we will check this out during checkout
  cookies[:ref] = {value: params[:ref], expiry: 30.days.from_now} if params[:ref] && !user_signed_in?
end
4. Then you can check for cookies[:ref] during checkout and apply the discount to the user accounts.

Probably the easiest solution for giving these coupons / discounts out is by simply updating each of the user accounts and applying a credit to each one. This way you don't have to deal with Stripe Coupons or roll your own subscription system.

Also, Stripe has a tutorial on using coupons that will be good to read through even though you may not use this: https://stripe.com/docs/recipes/coupons-for-charges

Posted in Building A Hosting Platform in Ruby Discussion

Yep, you'll just have to use the Custom VPS option and have your server created on Hetzner first.
Hey Allison,

It's still a work in progress, but let me upload it and share it for you. I know several other people have asked and I just never really felt it was ready enough to share, but then anyone can help fix bugs. :)

Posted in Condition if devise action view

I think it is:

<% if devise_controller? %>

Are each of these SSL certs in a separate file?

Are you restarting nginx with `nginx restart` or `nginx reload`?

I've never dealt with near that many SSL certs so that's certainly a new problem to me. I did find this blog which talks about handling 1022 sites and SSL certs with server configs: https://jeremyfelt.com/2016/01/16/managing-ssl-certificates-and-https-configuration-at-scale/ Seems like it has a couple tips that might help.
As far as Heroku goes, I had to add the nodejs buildpack to my Rails app so it would properly compile Webpacker with Ruby. You basically end up with both the Ruby and Node buildpacks and that gives all the Ruby and Node/Yarn versions required to get things going.

Posted in Building A Hosting Platform in Ruby Discussion

It's actually completely custom. I exported my Disqus comments and imported them into the forum. Then extended the forum to have nesting. There are still a few warts here and there because it's doing double duty for comments and the forum, but I'm going to try to clean those up tomorrow.

Posted in Rails & Vue.js Trello Clone - Part 2 Discussion

Make sure you're using rails-ujs and have it included in your asset pipeline. It was introduced in one of the newer versions of Rails to remove jQuery. If you're on an older version of Rails you can either upgrade or change the Rails.ajax to jQuery's version.
Hey Jacob,

Those files are from the new bootsnap gem. They're caching your application's require paths and things in a binary format so your app boots WAY faster. You don't need them stored in your git repo. 

Posted in Building A Hosting Platform in Ruby Discussion

Just thought I would share this in case anyone is interested how Hatchbox.io works. 👍

Posted in Rails & Vue.js Trello Clone - Part 1 Discussion

I literally just rebuilt the comment system (replacing Disqus) so there are some bugs. 🤓

You can think of that approach as similar to binding your events in jQuery. I worked on a nice little wrapper for that which I need to release. And once I get a chance to check out this other approach, I'll let you know. Might be a better way to structure things. 

Posted in Rails & Vue.js Trello Clone - Part 1 Discussion

Hey Justin,

You can do multiple components on a page by creating multiple Vue apps. You'd basically just mount your different Vue apps to the appropriate tag, if you find them on the page. You won't necessarily have them on every page, so you'll need to conditionally check to set them up. 

This is what I do with the Vue-Turbolinks integration. You can see an example here that checks each turbolinks pageview for the components and then sets up the vue app. https://github.com/excid3/vue-turbolinks#running-vue-only-on-specific-pages

You'd just do the same thing basically. 

I also noticed that Laravel seems to have an interesting way of doing things that is using the whole server sided rendered HTML as the main component. It seems like it might be a really useful way of doing an even nicer middle ground.
Thanks Stephen! Good catch on the YouTube URL.

Thanks for sharing Neil!

Hahaha I noticed that too while editing. Forgot I was recording without power. :P

Posted in Hatch login Error

No problem! I just disabled it temporarily for you. You should be able to login without it. Let me know if that works!