Rails Revisited
A collection of 34 posts
Rails Revisited
A detailed walkthrough of migrating a modern JavaScript site back to Ruby on Rails, exploring why Rails might still be the best choice for many web applications.
· Rob Conery
Wrapping Up
We're all done - but was it worth it? Being honest: both yes, and no.
· Rob Conery
Setting Up S3 CDN
We don't want our CMS images served from our disk in production, so we need to set up a CDN. I'll use S3 as that's what I know.
· Rob Conery
The First Deployment
If you've worked with Rails, you probably know that the first deployment is usually a matter of herding 100 or so cats. Still the same.
· Rob Conery
Preflight Check
We're just about there! Our app container and database are setup, now we just need our code to live on the server.
· Rob Conery
Setting Up A Dokku App and Database
Setting up Dokku is all about executing some remote commands. In this video, we'll set up our app container and database, and finally push our existing tables and data.
· Rob Conery
Deployment Considerations
How and where you deploy your site is a highly subjective thing, based on cost and experience. I'll share what I do, just for fun.
· Rob Conery
Some Tips and Tools
Let's close out The Rewrite section with some tips and tools. Some of you might be using MongoDB, or just not dig the ActiveRecord pattern. This is OK.
· Rob Conery
Filtering Routes
Controllers have a set of hooks, if you will, called filters. You can run code before, after, or both.
· Rob Conery
A Look at Rails Tests
Testing in Rails is extremely simple - the generators do a lot of it for you! In this video we'll have a look at what these generated tests look like.
· Rob Conery
More Complex Many to Many
Some many to many relationships are a bit more complex, such as relating customers to products through invoices (for instance). Let's see how to do this in Rails using a 'has many through' relationship.
· Rob Conery
Editing Many to Many Records
Rails gives us some great helpers that save so much time, and you're about to meet one of them: collection checkboxes
· Rob Conery
Many to Many Associations
Many to many associations are common in the database world, and working with them on forms (and with models) can be a pain. Rails makes this easy.
· Rob Conery
Scaffolding Everything
Now that we understand scaffolds, let's create some for the main tables in our database.
· Rob Conery
Using Scaffold With Existing Data
Scaffolding is a major productivity booster with new applications - but you can also use it to speed up your rewrite with existing data.
· Rob Conery
Flexing Make
I love using Make, especially when it comes to working with my database.
· Rob Conery
Integrating Devise and Spina
Logging in twice is a pain! Let's ditch the Spina auth system and use our own Devise one.
· Rob Conery
Adding Social Login With OmniAuth
Social login is imperative for web and mobile applications, so we're going to plug in OmniAuth, allowing our users to authenticate with Google and GitHub.
· Rob Conery
Logging Out and Registering On the Fly
Let's see how to logout with a single click, and what might get in our way. We'll also ensure that users can register on the fly.
· Rob Conery
Using Passwordless Login
I don't like storing passwords, even if they're hashed. You don't like remembering them, so let's setup a simple email link system.
· Rob Conery
Installing Devise
When it comes to authentication, most people in the Rails world use Devise. Let's install it and see how it works.
· Rob Conery
In The Real World
We've cover most of the Spina concepts which should set us up for success. That said, you will probably not want your entire site controlled by this package.
· Rob Conery
Making Your Own Embed
The Trix editor is, in a word, 'basic'. It's also extensible, which comes in very handy when you want to do things like add code samples and Vimeo videos.
· Rob Conery
Importing Data With Migrations
If you're trying to port existing data into Spina, Rails migrations might be your best choice. You can read records from an existing database, your existing CMS, a CSV or a JSON dump.
· Rob Conery
Creating a Sales Page: The Layout
In my explorations, I found that using Repeaters for each section of my page was the most flexible option, though, yes, probably not what was intended.
· Rob Conery
Creating a Sales Page: The Repeater
There a few ways to structure a more complex page with Spina, so let's use the example of a long form sales page and see what we can make!
· Rob Conery
Defining Parts of a Page
Working with any CMS involves concepts and jargon that are nondescript and overused, and Spina is no different. In this video we'll get to know what Parts are, and how they fit into Pages.
· Rob Conery
The Spina Layout
There's no styling to your pages when you install Spina, which is a good thing, as you'd probably throw it out right from the start. Let's see how to add some style to our site now that our CMS is up and running.
· Rob Conery
Setting Up Spina
Installing Spina is _reasonably_ straightforward, but there are some nuances (like routing) that you'll need to understand.
· Rob Conery
Our First Scaffold
Rails is famous for its scaffolding system and was the very first thing DHH demo'd on stage all those years ago. Are they still useful? I think so! Let's see why.
· Rob Conery