Chris Oliver

Joined

262,310 Experience
25 Lessons Completed
287 Questions Solved

Activity

Posted in Use Redis as a way to update a model along a process

If it's just something simple like product IDs, you could use redis. Rails now has kredis which you can use for that: https://github.com/rails/kredis I've been meaning to do a screencast on it.

If it's more complicated, you probably want to store in your database. Redis is just for simple key / value storage so you can't store anything too complex in there. You can sort of cheat and save a json object as the value, but then you have to de/serialize that every time you access it.

Guess it kind of depends on what you're doing as to what would work best.

Posted in sending the simplest of emails? (ruby or RoR)

It's looking for an SMTP server running on your machine on port 25. You'd have to run something like postfix to do that.

Posted in GoRails forum report spam feature - broken?

Looks like maybe Rails UJS isn't firing the request as a PUT. I'll take a look and see if I can reproduce it. 👍

Posted in learning path

Check out the brand new Ruby on Rails for Beginners course: https://gorails.com/start

Posted in Sharing Personal SAAS Tools...

Great work Mike! URL shortener is such a fun project to build in Rails. 👍

Posted in "rails for beginners part 21"

The Rails 6.0 to 6.1 is really simple, so you should be fine upgrading. 👍

The update task is pretty easy: bin/rails app:update

And of course, all the details are here: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html

Posted in "rails for beginners part 21"

Make sure you're using the latest Rails version. I don't think this works in older Rails versions.

I just updated this lesson for Omniauth 2.0. 👍

This episode has been updated for Omniauth 2.0. 👍

Posted in How do I track the clicks to an external url?

Two options that come to mind are:

  1. Have the link go through your Rails app, track the click, and then redirect to the URL (also get to hide the URL this way)
  2. Use Javascript to record the event on click (you could use Google Analytics, Mixpanel, Ahoy, etc)

Posted in how to unsubscribe?

You can cancel your subscription in the Billing section of your account.

Using RVM is just fine! Don't worry about switching to rbenv if you're already on RVM.

Posted in How do I use paddle_update_url on pay-rails gem?

Post this on the Pay issues. 👍

Posted in Time in top left corner chrome extentsion

The timing widget on the page is Rack Mini Profiler: https://github.com/MiniProfiler/rack-mini-profiler

You can query the database if you are using the database delivery method.

Posted in How to initialize datepicker in stimulus controller?

Turbo:load runs when a page loads, not a frame. It's the same as the old turbolinks event. Frames are independent from page views which means you need to setup a Stimulus controller instead.

Check out stimulus-flatpickr and you won't have to build anything. 👍

https://github.com/adrienpoly/stimulus-flatpickr

No screencast yet, but their readme is pretty well documented. 👍

Posted in Rails 6 basics issue

Rails comes with the webdrivers gem now and you should use that now. It makes things a lot easier. In fact, there's nothing you have to setup other than just installing the gem (unless you want to customize it).

https://github.com/titusfortner/webdrivers

Posted in get data from once working db

You can run rails db:migrate to run all the migrations in the db/migrate folder. That will make sure all your database tables are created. It won't restore any data, just the tables and columns though.

rails db:seed will populate the database with example records (assuming there is code to create records in db/seeds.rb. 👍

Posted in Upgrade strategy from Rails 4.2.4 to 6.0.3.4?

Upgrading from 4.2 to 5.2 to 6.1 would certainly give you some thorough testing of the changes and would be a bit less daunting.

You can probably upgrade straight to 6.1, but you'll want to go through all the upgrade notes to make sure you know of all the changes between. Things like belongs_to being required by default might catch you off guard if you skip straight to the latest version and miss that in the Rails 5 release notes. 😅

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

© 2021 GoRails, LLC. All rights reserved.