I will be using ActionMailer and SendGrid to setup a basic contact mailer, where a person can fill out a contact form, and an email will be sent to the site owner’s email address. I like SendGrid because it works well with Heroku which is the service I use to deploy my apps in production.
Getting a Git workflow going with Heroku can be rough. Using Rails, this tutorial works on granting a new developer access to a development environment, where your code can be worked on locally, a staging environment where your code can be pushed to Heroku first to make sure you haven’t broken anything, and finally a production environment where your code will be pushed directly to your website. Additionally there will be lists of other commands that are frequently used in various situations in Git and Heroku that will be compiled at the end.
Puma is a web server that can be used in Rails Production and Development environments. It is the default server for Rails 5, but if you’re using an earlier version, it needs to be installed. Although the regular Rails server works fine, Puma is recommended if you’re going to be deploying your app to Heroku.
From development to production – best known as another phase in the app designing process for your perfectly fine development code to error out and blow up on you. Deploying to Heroku is supposed to make this easier. Most of the time this is true, sometimes though, it’s just not. Here is a simple guide for deploying a Rails app to Heroku.
Testing models with RSpec is essentially one of its primary uses. After all, you do want to make sure your backend logic is working, and models are where most of that logic should go.
For more information about testing, Everyday Rails Testing With RSpec is a great source for learning more about testing Ruby with RSpec. A lot of the following was built using this as a guide.
(This article assumes a rails app and database have been created and that the developer has an intermediate understanding of Rails).
Behavior-driven development (BDD) takes the position that you can turn an idea for an app or feature into product ready code that’s specific enough for both the developers and clients to understand what’s going on. There is a focus on creating tests that are written in natural language constructs, making it easier to identify what part of the website is not working. It’s BDD that’s at the heart of using RSpec, which is a software testing tool for Ruby programmers that tests the functionality of an application.
The following explains how to install RSpec along with some other testing features that can be used in your Rails app.