How to share tests for before_actions in Rails

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 I’ve created an Admin::BaseController that the other admin controllers inherit from and I put my s...

Keep Reading

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

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. #GEMFILE gem 'bootstrap', '~> 4.3.1' Run bundle install in your command line. $ bundle insta...

Keep Reading

How to set up a subdomain on Rails localhost

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 there were a few things that changed based upon the subdomain, such as displaying the appropriate compan...

Keep Reading