Chris Oliver

Joined

247,110 Experience
18 Lessons Completed
271 Questions Solved

Activity

Still waiting on them to release those Ruby versions. You can use a Ruby Docker image instead or compile and cache Ruby as part of the steps. Other than that, we just have to wait for 2.6.5 support to use setup-ruby. :(

Posted in How to use Bootstrap with Webpack & Rails Discussion

Sounds like you probably missed a step somewhere. I just installed Rails 6.0.2.rc1 and went through the screencast. Everything works correctly.

Posted in Ruby 3x3 Performance

Ruby 3 will have both Fibers and Guilds. Matz talked about it in the Rubyconf keynote this year: https://www.youtube.com/watch?v=2g9R7PUCEXo

Controller methods are not available in the view unless you expose them with helper_method :sort_column

Yeah, that would probably work fine for now. I'm not sure when Rails 6.1 will come out but it might be a little while so you'll probably need a solution like this until then. This basically replicates what Shrine would do for you.

Posted in How to use Bootstrap with Webpack & Rails Discussion

Does it render a different layout? And if so, have you included the stylesheet tag in that layout?

Passenger is an Ubuntu Linux package, it will install any dependencies required automatically. You don't have to worry about them.

You can just skip to the install NGINX + Passenger step if you don't want to install Rails for whatever reason.

Posted in What makes you like Ruby/Rails?

I personally love Ruby because the language is designed for humans first and foremost. You don't have to jump through hoops to make the computer understand it, so you can spend your time thinking about how to communicate ideas in your code. That saves a ton of time in development, and humans are typically the most slow and expensive part of software development.

Rails takes advantage of that and assumes you know the basics of web development and does as much as it can for you. You don't have to worry about the different between GET and POST params, they're just available to you in one spot. There are tons and tons of situations where Rails has already got tools for something I wanted before I knew I wanted it. That's amazing.

The downside is it isn't cool anymore, but if you're doing things just because it's cool, you'll probably be wasting lots of your time. 😜

Posted in How to import javascript from Gems with webpacker

Yep, you can do that. Or if they have a node package, you can use that instead.

Posted in How to import javascript from Gems with webpacker

Just import it in app/javascripts/packs/application.js

import "../myfile"

And put your code in app/javascripts/myfile.js

Also check out https://gorails.com/episodes/webpacker-javascript-in-rails-6

ActiveStorage URLs always go through your Rails app. That's how they generate the resize 200x200 on the fly without precomputing it. That's the primary downside to using ActiveStorage right now.

In a future version of Rails, they will have an option to use direct urls to AWS, but you can't do that right now.

If you want this feature today, you'd be better off using Shrine for file uploads.

Lockbox or attr_encrypted are great for that. You just define an encrypted column instead of your normal one and add a secret key.

Posted in Multitenancy with the Apartment gem Discussion

Hahaha, I noticed that the other day. It won't capitalize, I couldn't paste. SimpleMDE is not very good on mobile it seems. Might have to replace it with Trix, but we lose Markdown support. :(

Posted in Skip Stripe checkout for user with certain conditions

Hey Anthony,

After the user signs up through the referral link, you can add the free post to their account. That might just be a column on the user model to keep track of it, up to you.

Then you can check if the user has a free post and let them post. If they don't, redirect them to the pricing page. You probably have a before_action in your PostsController to redirect if not subscribed, so you can modify that to allow them through if they have a free post. Once they complete the Post, then they you can remove that column on the user so they can't do it twice.

Posted in Welp. They just let me go.!!

Oof, that sounds awful. Any company should expect that you have a month or two of onboarding as you get used to the product, how it works, and how the team makes decisions and implements things.

If a company is still on Ruby 1.9.3 and Rails 3.2 these days, then they've probably got some serious technical debt and don't know how to dig themselves out of it. That's a bad sign.

Sounds like you dodged a bullet!

Posted in Multitenancy with the Apartment gem Discussion

Citus which is a Postgres company designed around supporting multi-tenancy always recommends using row based segregation. They've built this gem which I would highly recommend. https://github.com/citusdata/activerecord-multi-tenant

Posted in Scheduling Posts Discussion

CoffeeScript works just fine in Rails 6. https://github.com/rails/webpacker#coffeescript

Posted in User Referral Program From Scratch Discussion

You can just call the complete_referral! method anytime the user completes the steps you want. If you want to do that right after registration, go add that after sign up. πŸ‘

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.