How to install ImageMagick 7 on Ubuntu 16.04

David Anderson | May 20, 2019
I recently had a need to convert heic image files to jpg using ImageMagick. On my computer I didn’t have to do anything different than what I’d normally do to convert an image from one format to another. This was working perfectly: $ convert image.heic image.jpg Unfortunately, when I tried t...

Keep Reading

Crop photos with Rails, Paperclip, and cropperjs

David Anderson | May 07, 2019
In a previous post, I shared how I integrated the Jcrop jQuery library to offer a cropping interface on the frontend which updated hidden fields in a form that was submitted to our controller to crop the photo using the paperclip gem. The below tutorial is essentially the same, but in this case w...

Keep Reading

Paperclip run processors for specific style

David Anderson | May 06, 2019
If you have a Paperclip custom processor that you want to run on specific styles, you can change the has_attached_file styles hash so that each style includes a processors array. For example, in the code below only the full and thumb styles will be sent to the cropper processor. has_attached_f...

Keep Reading

Crop photos with Rails, Paperclip, and Jcrop

David Anderson | May 03, 2019
Are you having trouble putting all the pieces together to allow users to crop a photo and save the cropped photo to your model using paperclip? You have a user model with a paperclip attachment for the user’s profile photo and using the Jcrop jQuery library seems straightforward enough, but how d...

Keep Reading

Learning Rails? Follow this newsletter, blog, and forum.

David Anderson | Apr 28, 2019
Have you started to learn Ruby on Rails? Maybe you’ve hacked your way through one or two tutorials or finished up your first client project. You know you still have a lot to learn, yet you’re not really sure where to go from here. How do you continue learning and start to grasp concepts beyond t...

Keep Reading

How to share tests for before_actions in Rails

David Anderson | Apr 24, 2019
Checkout the example below to learn how I share tests using Rails testing in a similar way to RSpec’s shared examples For this site I have an admin area where I manage the blog posts and site images. My routes look something like: namespace :admin do resources :posts resources :images end ...

Keep Reading

How to add and customize Bootstrap 4 in a Rails 5 app

David Anderson | Apr 20, 2019
There are a few different ways to integrate Bootstrap into your Rails 5 app, but we’ll get it working by installing the official bootstrap gem. The instructions on the gem’s github page are great, so the following is really just a reprint of what you’ll find there. Add the gem to your Gemfile. ...

Keep Reading

How to set up a subdomain on Rails localhost

David Anderson | Apr 20, 2019
I recently worked on a client project that required setting up a subdomain for each of the client’s customers. For example, they wanted to use company1.everclimb.co for Company 1 and company2.everclimb.co for Company 2. Though the app was essentially the same for both Company 1 and Company 2 ther...

Keep Reading

SUBSCRIBE

Drop your email in the box below to subscribe to my newsletter. Once per week you'll get Ruby/Rails tips, guides, job postings, and general thoughts from the web developer trenches.