Welcome to Meddle Dev Log! As I work on my new project meddle, I’ll be documenting my work here, for other junior developers like myself to follow along. However, I am no position to write a tutorial, there will be blood, sweat and tears, and by NO MEANS should anyone consider this project a step-by-step to making a rails app. However, I encourage anyone interested to work with me, either by reading along while making your own app, or making improvements and submitting pull requests to our github repo. Or you can follow along and watch me break down when I can’t find the error on line 45 of app/controllers/pages_controller.rb, DAMMIT!
Well, that’s the gist of it, pun intended. So let’s get started!
Commit: First commit
Alrighty, starting fresh. Let’s jump right in why don’t we? As with almost every rails application, I started my work by creating a new project.
rails new meddle
This was a mistake that I’ll have to deal with later. The mistake was that I plan for this program to work with as little setup as possible on a DigitalOcean server, or Droplet. Droplets use PostgreSQL as a database and Unicorn for a web server, which means I’ll have to configure my rails app to use Postgres manually. This I’ll deal with late as it isn’t the most important issue. But to save some time, you can preconfigure your rails app by adding
--database=postgresql when executing your
rails new command.
Before I started work on my project, I did research on some gems that I thought would be useful for my app. I wanted to do a backend from scratch, so I dropped Casein from my list, BUT I new I wanted to have user authentication, which almost by default means Devise has a role in our project. After about an hour or so of the same research and consideration, I found the gems I wanted to use.
After editing the Gemfile, we save it and then run
bundle install. For setup, visit each gems github page and check out their README for instructions. After running setup for Devise (I called my model “User” because I’m original) and playing with boostrap, which is apparent in the views posts/_form.html.erb and devise/registration/new.html.erb, I started my rails app with rails s and appreciated the results. I’ll check in later when I figure out a good user structure.
Until next time, Network!