Recently, I ran into the problem that my image heavy website, patagoniaonabudget.com, was loading extremely slowly. In this post, I outline the steps I took to go from a 6 second load time to under 2 seconds, specifically focusing on image rendering.
How To Make A Facebook Messenger Chatbot
In this post, I'm going to walk through how to make a Facebook Messenger chat bot using my open source Survey Bot Repository. By the end of this tutorial, you'll have a fully functioning bot that responds to a series of questions and saves the information to a database
Website Scraping Using Ruby and Nokogiri
In this post, we're going to walk through how to scrape website data in Ruby. We'll use the Nokogiri gem to grab HTML data from Hostelworld, store that data in an array, then print hostel prices to a CSV file. This is an easily extensible block of code that you can use to pull data from around the web.
Parse JSON from HTTParty using Ruby on Rails
How To Add A Foreign Key in Ruby on Rails
This article will walk through how to create a simple application that has two databases that relate to each other using a foreign key. Unlike formal documentation, my hope here is that by demonstrating the actual uses in migrations, models, controllers, and views, it will be easier for others to implement this feature.
How To Make a Newsletter Form in Ruby on Rails
Many applications and websites require e-mail capture to target leads, subscribers, and customers. This is a tutorial on how to create a reusable newsletter form for e-mail and any other user information your app requires. We'll use a brand new app for the purposes of this example, but this code is extendable for most existing Rails apps as well.
Getting Started with HAML on Rails
The HAML syntax is like installing all the software updates on your computer: at first it seems like upgrading is going to take forever and it's not worth it, but once you're up to date the time saved pays for itself and you could never imagine going back to your old ways. You can also learn a ton from the official HAML reference, but consider this a cheatsheet to bootstrap your proficiency and get started with some of the major use cases.
How to Implement Elasticsearch in Rails
Nested Forms in Rails Example
In this post I'm going to walk through a skeleton app with basic functionality to create nested forms, which enable the creation of new objects in multiple models at the same time. For the example application, we'll create a workout tracker with a form that can create workouts and the specific exercises within that workout.
RubyGem acts_as_votable Tutorial
Reddit. Quora. ProductHunt. What do all of these websites have in common? Besides their rabid fan bases, they enable a community to interact with content via simple voting buttons that users can click on to promote or demote content. Luckily for Ruby developers, there's an awesome gem I came across this week that quickly builds the same functionality. Here's a tutorial on how to get started with acts_as_votable.
FitBit on Rails
Ruby's Enumerable Module
Ruby's enumerable module consists of a number of helpful methods to write tight code when manipulating collections of data like arrays and hashes. Although the formal documentation contains a great overview of all the methods, it can be daunting to sift through which ones are actually useful and how to implement them. Let's explore some of the best right here!
Fibonacci Algorithm in Ruby
Over the course of the last few weeks, I’ve been diving into the wide world of algorithms. Although they can be intimidating at first, constructing algorithms is just the coding version of solving a puzzle, which activates the creative problem-solving capacity of your brain and can actually become quite fun.
DIY Authentication in Rails
How To Import CSV Files In Rails
How to Make a Twitter Bot in Ruby on Rails
This week, I'm going to walk through the steps to start automating a Twitter account to perform a variety of useful functions using the Twitter API. You can also view these instructions in the readme file of my Github Repository. If you're not interested in the code, you can just skip to the bottom to see what the bot does.