House of Rails

Andrew House

Homework App

I built an app which some of my fellow students can use as a medium to give progress on their homework assignments.
My App uses Devise for registering users, Heroku as the means for depoloyment, and a vast array of fun gems. The whole point of the app is that there is a central place where our teacher (James Dabbs) can check our homework progress. James is the only authorized user (admin) capable of making new assignments. Then each student can update the status of their homework by selecting a created assignment, post the link of their website, and check to see if the assignment has been completed.

I think it works pretty well, all of the CSS was done with the help of Twitter Bootstrap. If you are interested in checking out my code, I have it posted on Github.
But yea, making apps are fun. I had a lot of challenges in this app. Something different I did in this that I had never done before was implementing a has_many_through relationship. It required me to do quite a bit of reading to see how each piece interacted, but in the end it was totally worth it.

Figaro

Once upon a time when I didn’t know what I was doing.
I was trying to setup a rails app for my wife and have her family upload images and a birthday message. After some research, I decided to use Amazon Web Services to host my images. I got it configured in my rails app with Paperclip and that is when I made a fatal, fatal, fatal error.

I put in my bucketname and password directly into my code.

The following morning, I received a call from Amazon. Confirming whether I had setup 5 instances across the world racking up $250 overnight.
I freaked out a little.
After getting that resolved, I searched for how I can avoid making that stupid mistake again. My research turned up a gem called Figaro.
Figaro is used to hide confidential information. Usernames, passwords, you name it and it will store the variables in a file that will be automatically ignored from git and can easily be configured for Heroku.

Getting Started

As always, you want to start by adding Figaro to your Gemfile.

Gemfilelink
1
gem 'figaro'

Twitter Bootstrap Rails

Being entirely void of creativity, the Twitter Bootstrap Rails Gem is amazing.
I use Twitter Bootstrap(bootstrap for short) to generate basic layouts so I can get a handle on how things can possibly look. Not to mention, it gives an amazing starting point for building good looking css. If you visit the Twitter Bootstrap Home Page, you can see all of the styles you can create. If you are a beginniner, ignore anything and everything Javascript related. Stick primarily to the CSS and Components page and customize your page with their features. A little pizzazz goes a long way ya’ know.

Getting Started

I am assuming that you have a new rails project and are looking to add bootstrap to that project.

Let’s start by adding the ‘twitter-bootstrap-rails’ gem to the Gemfile.

Gemfilelink
1
gem 'twitter-bootstrap-rails'

Gem Choices

Gem’s make my Rails world go round.
However, there are so many gems around that it would take entirely too long to comb through them all. I do have a method that helps me select certain gems from others.
Documentation.
If a gem is lacking in how-to’s, tutorials, or efficient documentation-I typically skip over it. For example, one of my favorite gems is Simple Form. Simple Form allows forms to be a little easier to read. My favorite part about it?
Look at all of that documenation on the Github page.
I love it. There have been situations where I use gems that don’t have great documentation. Typically that is when I’m desperate for something and have exhausted my resources. Odds are, the gem is a failure and I crawl into a little hole for a few minutes. Alas, gems are great to use and their documentation/codebase allows for steady knowledge and easy implementation.

Sinatra Is Fun

I never really gave Sinatra a chance.
After reading articles after articles about how much better Rails is than Sinatra, I kind of swept it under the rug. I was sooooo wrong.
Sinatra is crazy light weight. Not as many bells, whistles, and not near as many headaches that come with Rails. It’s simplistic, and I like that. Today I built a fun Sinatra app and I had a really great time. I didn’t try to make it too complicated, just trying to get used to haml and getting into the groove of how sinatra should feel.

I enjoyed how some of the magic that you take for granted in Rails is peeled apart in Sinatra. Making my own get/post requests and assigning routes was fun. I may be overplaying it, and I know how beneficial rails will be when I take on a larger app. But I have to say that now I will turn to sinatra for low level simplistic apps. Kudos to James for making us play with Sinatra.

Starting Over

I LOVE to play around with new features.
Tonight I was playing around with omniauth-github and trying to log in via rails. I was able to log in (horray!), but I had forgotten what I was supposed to be doing initially. It happens to me every now and then; I get feature focused.

I’m so focused on getting this one little thing to work I lose track of my goal. It’s times like this, when I’m barely into the project, and I was able to get my feature to work. I find that it’s best to scrap it and start over. My reasoning?

  • Start on a path where I am able to remain focused.
  • When it is time to create the feature again; I will do it again from scratch, forcing myself to learn.
  • In future projects, I will know to be well prepared and focused from the get go.

    Long story short.
    I played around with a cool thing, got it to work, messed up, started over, and didn’t loose any passion. Not a bad thing if you ask me. I’ll learn, grow, and do a better job next time.

  • Designing a Website

    An eye for art I do not have.
    I can’t paint, draw, sculpt or any of the like. When it comes to making things look good, I have to say that I am a numskull. However, I think designing a website is incredibly challenging and somehow fun. I’m not very fluent in css. I can read it just fine, but when it comes to creating my own css from my own ideas, I find it hard. I tend to use tools like Twitter Bootstrap, ones that can give a default layout and style without me having to give it much thought. After a talk today with Sam Kapila, I felt a little at ease when thinking about web design.

    It’s all about the User Experience.
    Making the person who is going to read my page to feel comfortable. Not having to search for what they need, making it very clear, and using tools/tricks to have a much easier reading experience. For example, something as simple as not having the lines of text too close together. I typically don’t think about things like that. I have a very backend oriented brain. I just needed to use my perspective to design.
    Then I had a lightbulb moment.
    Pay attention to certain details on websites that annoy me and don’t do that(also the opposite). It’s simple. Do I hate that color? DON’T DO IT. Do I like the way that navigation is laid out? Inspect that element and see what they did. I believe I’m making designing harder than it is. I just have to KISS (Keep It Simple Stupid) it a little.

    It’s Electric

    Electricity sure is annoying.
    I end up using it most of the day. Whether it be by charging my laptop, heating up dinner, or watching tv. Electricity encompasses my life.
    I’m not saying I don’t particularly like it, I just hate being dependent on factors I can’t control. Currently the power is out at my apartment and I find it incredibly frustrating. The thought of how we will use power in the future gives me great joy. Affordable personal solar panels that are easy to diagnose? Yes please. I’d even take a Soylent Green-esque treadmill that could power my apartment.

    I know that I’m overly dependent on electricity; my profession pretty much relies on it. If something happened and we went back to the stone age, I would be royally screwed. I do enjoy the era I was born into, and I look forward to the future and what humanity will come up with to fill the void for everyone.

    Being Object Oriented

    I love designing classes in an Object Oriented fashion. It gives a good feeling, like there aren’t just a bunch of empty method. Each method belongs to something larger, each piece makes the whole complete. Object Oriented Programming (OOP) just makes sense to me.

    Motivation

    Sometimes it is difficult to find the necessary drive to complete tasks. That doesn’t happen to me when I code. When I get started with an idea or a project, I’m fully immersed. I like to think of it as a coding high. When I’m in the zone, writing remarkably precise and efficient code. It’s a wonderful and beautiful thing.