Activity
Posted in PDF Receipts not working
If the link is 404ing, then you either don't have routes, or your links are wrong. They should look something like this:
# config/routes.rb
resources :charges
<% current_user.charges.each do |charge| %>
<%= link_to "View Receipt", charge_path(charge, format: :pdf) %> # tried this, didn't work
<% end %>
Posted in How to deploy in Google App Engine?
That's a great idea. I've been meaning to look into Google Spanner and stuff anyways so I'll have to try this out and make a video on it.
Looks like there are several good options for running Rails on there: https://cloud.google.com/ruby/rails/
I found it easiest to just listen for the webhook and remove the subscription then. This makes it simpler so your code doesn't have to add in an exception for the case of a user who canceled but is in their grace period and so on. That said, it's not really significantly different to just cancel at period end and also record that data to the user's subscription. You should have both the period end timestamp to record and the subscription could be marked as canceled too. The only adjustment is to make sure that subscriptions in the grace period are still considered active.
Just for reference this all got sorted out in Slack for anyone reading this later on: https://gorails.com/forum/h...
LOL this is great. Slack regurgitation to the forum.
Posted in Looking to upload files to local file storage on server. Recommended best to handle multiple?
Yup, you just don't need to do the presigning but the Javascript library will still help you control multiple file uploads on the frontend.
This line is what uses the JSON response and Turbolinks to redirect to the team page: https://github.com/gorails-...
And you should keep Turbolinks, it's awesome. :P
Posted in Setup Windows 10 Discussion
Because compiling Ruby takes a lot of CPU power.
Hey Haytham! Great to have you. :)
Shopify actually has quite a few different methods of integration. There are all kinds of different things you can do with it. I don't personally know too much about it aside from just using their API, but I'd probably start with trying to figure out what type of integration you want to build with them. They list a bunch of the options here: https://help.shopify.com/api/sdks/shopify-apps
Posted in Looking to upload files to local file storage on server. Recommended best to handle multiple?
By default it's going to accept any file types no matter what you use for file uploads. All those files will get their own database records if you have it so each upload is sent individually. That's what we covered in this episode: https://gorails.com/episodes/multiple-file-uploads-with-shrine
Give that a watch and see if that answers most of your questions. 👍
Since this never really hits your Rails app and the uploads are direct to S3, the configuration is gonna have to be on the S3 side. This post here (https://aws.amazon.com/articles/1434) talks about setting a policy where you define the content-length-range which will correctly reject the file upload if it's outside those boundaries. I'm not quite sure exactly where that goes, possibly it has to be passed into the Shrine when it generates the presign signature unless it can be defined in S3 itself (which might be possible too). Probably work posting an issue on Shrine to ask for his advice there as he'd konw more about this than I do.
Posted in Spell check
Unfortunately I don't believe that SimpleMDE supports the browser's spell check functionality because it's a custom editor.
Posted in Authorization with Pundit Discussion
It shouldn't make any difference. Traditionally people do includes at the very top and that's what I generally do too, but in this case I just pasted below to make it a little more clear.
Posted in Where should I start?
Hey Kelvin! I'd recommend starting at the first episodes and working your way through them. I don't have a particular order or anything with GoRails, although I probably should. :)
GoRails is mostly designed to be like a reference for you. You might want to build a product with a specific feature and hopefully you'd find an equivalent episode in GoRails to add that feature. If you don't find one, just let me know and I'll try to cover it for ya. 👍
If you submit the delete
request, you could have two different Javascript snippets run, one for each of the different interactions you want to have.
For example:
// Hide the favorite
$("#favorite_<%= @favorite.id %>").hide()
// Make the item gray
$("[data-favorite-id=<%= @favorite.id %>][data-behavior='heart").removeClass("active")
This way your HTML can include the features you want on that page and the Javascript will modify whatever it finds on the page. I showed two different selectors you could use for this. I find using data-behavior to be particularly handy so you can have multiple pieces of functionality on the page for a single favorite and search for them easily.
Posted in How do I upload files larger than 2GB?
Hey Jimmy,
Yeah that stuff can be gnarly. Generally, it's probably best to do the direct to S3 uploads so that you aren't bogging down your server with uploads. That's going to take a load off your server and then you can process that file later in background jobs if needed.
I'm not really an expert on uploading massive files but that's probably the best place to start. I'm sure that Janko the author of Shrine can help with more ideas if you message him about it. Also maybe some other people in the community here have handled situations like that who can give some advice for uploading and processing big files.
Hey Stephane, I would do a join table for this because as things get more complex you'll want to probably support extra features like different roles for users in the room (like Slack allows you to invite guests to specific rooms) and the best way to do that would be with the join table. They're still fast to query and can store all the additional data you might want on it.
Posted in integrating analytics
Just for reference, this week's episode is on using Segment for analytics: https://gorails.com/episodes/analytics-with-segment?autoplay=1
Next week I'm also going to cover using the Ahoy gem for those of us who just need to track analytics internal to our apps.
As Jack mentioned, the RSS feed is probably the easiest way to do that: https://gorails.com/episodes/pro.rss 👍
Posted in Analytics with Segment Discussion
Yeah, for some things for example you may want to track form submissions. Frontend code generally would just track the form submitting, but not whether or not it was successful. This can be useful and you may want to know attempted submissions vs successful submissions as an example.
You're not going to be slowing down your code in either case. Frontend runs in the user's browser so it won't slow anything down. Server-side events are submitted in asynchronously so they won't affect the speed of your code there either.
As for complex integrations, generally analytics are just designed to be an additional line of code that runs in your logic. You will already have methods or classes for that logic so you'd just drop in an additional line to says "Purchase complete" after running through your payments code.
I'll try to come up with an example to go a bit more in-depth on. Generally analytics aren't anything too complex, you've just gotta make sure you write good names for events so they make sense when you're analyzing them later. :)