Looking for old posts? Visit the archive.
How to Extend the Ubuntu Default Logical Volume Partition
Chris Oliver
July 9, 2024
Using VirtualBox, I'll often give Ubuntu a certain disk size and only realize later on that it isn't using the full partition size for the disk.
Run these commands to extend the root filesystem to use the full disk:
```bash
lvextend -l +10...
Black Friday Sale 2023!
Chris Oliver
November 22, 2023
It's hard to believe it's holiday season already and 2023 is almost over. Our Black Friday sale is live and we do this every year as a way to show our appreciation for all the support the Ruby on Rails community has given us over the years. We've ...
Rails World 2023: Powerful Rails Features You Might Not Know Talk Slides
Chris Oliver
October 10, 2023
I gave a talk at Rails World 2023 in Amsterdam on Powerful Rails Features You Might Not Know.
If all you've got is a hammer, everything looks like a nail. In tech, there is a constant stream of new features being added every day. Keeping up wi...
Patching Models for Ransack 4.0.0: Extending ActiveRecord for Gem Compatibility
Collin Jilbert
August 22, 2023
Here at GoRails, we are running [ActiveAdmin](https://github.com/activeadmin/activeadmin) to power our administration area and we recently upgraded the version which we were running to version `3.0.0`. The ActiveAdmin engine has a dependency on [R...
How to test OmniAuth Params
Chris Oliver
January 14, 2023
OmniAuth provides some tooling for mocking OAuth requests in your test suite. This is handy because your tests don't have to redirect to a production OAuth provider like Twitter, authenticate with real credentials, and then handle the response.
...
Bundler default gem dependency error
Chris Oliver
January 6, 2023
Have you seen the following error?
```bash
You have already activated uri 0.10.0, but your Gemfile requires uri 0.12.0. Since uri is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that ...
Black Friday 2022 Deals on GoRails, courses, and Jumpstart Pro!
Chris Oliver
November 23, 2022
It’s Black Friday again, and this is our once-a-year sale!
It’s our way of saying thanks for all your support. You've been a huge part of making GoRails a success and Collin & I can't thank you enough. 🥰
Here's what we've got going on this ...
How To Test A Rails Rubygem Against Multiple Databases
Chris Oliver
March 30, 2022
If you're building a Rubygem that integrates with Rails and ActiveRecord, you'll probably want to test against multiple databases. This is pretty easy to setup for CI where you can run multiple databases in Docker containers with different steps, ...
Black Friday 2021 Deals on GoRails, courses, and Jumpstart Pro!
Chris Oliver
November 23, 2021
I run sales once a year on Black Friday as a way of saying thank you. You've been a huge part of making GoRails a success and I can't thank you enough. 🥰
Here's what we've got going on this year:
------
[**36% off GoRails with the yearly ...
How to render ActionText Attachments in Plain Text
Chris Oliver
November 2, 2021
ActionText supports custom attachments using Signed Global IDs. We can use this to embed any database record in Rails such as @mentions for users.
For HTML, Rails will use the `to_partial_path` to render the HTML template for the attachment. Fo...
How to use Partials in Rails
Blair Rorani
February 23, 2021
If you want to keep your code simple and/or reuse a block of code in multiple files, then you can store that code in an html.erb file called a partial.
Create partial 🧩
1. Go to app > views.
2. Create a folder called shared.
3. Create a fil...
How to add a Root Route to your Rails app
Blair Rorani
February 23, 2021
You need to replace the default, “Yay! You’re on Rails” landing page with a real index page for your app.
Create a route 🛤️
1. Go to config > routes.rb file
2. In the Rails.application.routes.draw method, enter the route:
`get root, to:...
How to add a Page to your Rails app
Blair Rorani
February 23, 2021
⚠️ This is how to add a page without any interaction with the model.
## Create a route 🛤️
1. Go to config > routes.rb file
2. In the Rails.application.routes.draw method, enter a route using the syntax:
[request type] "[URL]", to: "[con...
How HTTP Requests work in Rails
Blair Rorani
February 23, 2021
## Process overview
⚠️ This is how HTTP requests work without any interaction with the model.
[request] ➡️ routes.rb ➡️ [controller] + [action] ➡️ view ➡️ browser
1. A browser sends an HTTP [request] (e.g. /about)
2. The Rails server rec...
Black Friday 2020 Deals
Chris Oliver
November 25, 2020
This is a special time of the year to give back to the Ruby on Rails community. You have so wonderful and supportive of GoRails. 🤗
I'm running a big sale across all the GoRails products this year. I only do this once a year so if you're thinkin...
Dynamic Footer Timestamp in Rails
Chris Oliver
December 31, 2019
Ever seen the typical copyright message at the bottom of a website that's out of date? Yep. A surprising amount of websites have them!
`© 1992 Your Company`
Someone just hard coded the year and called it a day.
That's fine and dandy and i...
Limit Webpacker RAM on compile for production
Chris Oliver
December 12, 2019
If you're deploying Rails to production with Webpacker, you might run into a Compilation failed error from Webpacker.
Often this happens because Webpacker runs out of RAM and the operating system kills the command for using too many resources....
How to Test and Assert Link text is not on Page with Rails
Chris Oliver
December 10, 2019
Have you ever wanted to create an assert that tests if a link is NOT on the page with Rails? It's not easy to find an example of this. You can find some with Rspec, but not with Rails's builtin test suite using Minitest.
Typically you'll use `a...
How to test helpers in Rails with Devise current_user and ActionView::TestCase
Chris Oliver
December 2, 2019
Recently I was trying to test a couple of helpers I had written in Rails. Basic helpers are pretty easily tested using ActionView::TestCase, but what happens when you want to use Devise' `current_user` method in your helpers? We have to actually w...
Fill in Stripe Elements JS for SCA / 3D Secure 2 and Capybara
Chris Oliver
October 23, 2019
[Stripe Elements](https://stripe.com/docs/elements) Javascript now has support for Strong Customer Authentication (SCA) with 3D Secure 2 (3DS2). This makes handling these in system tests a bit harder. Filling out the credit card fields in the past...