We're so excited to launch the MiniCorp Engineering blog! For our first post, our senior software engineer Steve Thornton shares some of his favourie tools to help your Ruby on Rails coding.
Here at MiniCorp, we use the Ruby on Rails web application framework for the majority of our client projects. The beauty of the Rails framework is the amount of quality open source tools – aptly-named gems – that are at our disposal. The gems listed below are just a handful of the ones that we love and use the most, either for their simplicity (Letter Opener) or just the amount of time they save us writing boilerplate code (Devise, Paperclip).
Both of these allow runtime debugging of your apps. We tend to use byebug (comes as a default gem in Rails 5), but pry does have better REPL functionality.
This is a flexible authentication solution for Rails. This is our ‘go-to’ for authentication and has saved us countless hours setting up user authentication for projects. It is super simple to install and is modular, which allows you to customize your implementation to only use to modules your project requires.
This is a great little gem. When sending an email via ActionMailer, Letter Opener will display the email in a new browser window. This saves the numerous ‘test’ emails hitting your actual email account, something that can be annoying (especially if wearing a smart watch – tap..tap..tap).
Lots of our clients' projects require functionality such as uploading an avatar and attaching it to a user model or uploading document, c etc. Paperclip makes this super simple and is highly configurable. The most common setup we have for projects is for attaching images to various models. In development, the files are stored in the public/system (default) and in production, we have another configuration which utilizes Amazon S3 for storage.
This enables creating and managing database views for use in Rails applications. Scenic provides a similar migration mechanism to Rails, allowing versioning and rollbacks of views. You can also back your view with a Rails model, as they even provide a handy generator command that will create your view migration and model! This has come in handy for many projects; most recently, we used Scenic to create a highly optimised view exposing just the data we are interested in. We could then query the data in Rails via the model backing the view in a much simpler way.
Client requirements permitting, Stripe is our favourite payments provider. The platform is solid, easy to integrate and the Stripe API reference is very detailed with example requests and responses. We have used Stripe on various projects for simple payments as well as Stripe Connect for more complicated payment scenarios in which we need to handle payments on behalf of others (think Hailo/Uber paying its drivers).
Custom post graphic by Danielle Morgan.