Starting a “professional” Rails app with Haml, Rspec, Devise, and Web App Theme

Update 2: This tutorial is way out of date. If you want to create a modern (ie. 2015) app, please use a generator like RailsBricks.

Update: Tutorial for Rails 3.1 here!

crud screen

Every Rails developer knows how to create a Rails app. It’s easy as

rails new APP-NAME-HERE

But how many know how to create an app from scratch that looks good enough to sell to clients i.e. with slick design, authentication, authorization, and all that? Sure, there are tutorials out there that cover those components, but most of them cover them only in isolation from each other. A quick tutorial containing multiple components at a time would be a valuable resource to anyone planning to start a new app.

As the resident dilettante in these parts, I’ve decided to create such a tutorial based on a recent demo I made for a prospective client.

This post will discuss how to create a Rails 3 application that looks good enough to sell to clients (of course, YMMV) while still having components found in “professional” apps. This tutorial will cover the following:

  • Andrea Franz’s web-app-theme gem – I only recently found out about this theme generator gem. Had I discovered this sooner, I might not have made “I hate web design” a catchphrase. Basically this gem generates themes for your web app (hence the name). The demo and the list of available themes can be found on this page. The main downside to this gem is the lack of tutorials on the net about it. Hopefully this post will give people an idea what to expect with the gem.
  • Devise – our authentication module. Authlogic‘s fine, but I find Devise’s approach less obtrusive.
  • Haml – replaces Erb. Not perfect (e.g. screws up with inline a tags) but the drastic decrease in code makes passing it up difficult.
  • Rspec – replaces Test::Unit. Only setup will be covered in this post, actual usage is left to the reader.
  • will_paginate – gem for pagination. Everybody uses it, so what the hell…

Rest of the tutorial is below the cut.

Continue reading “Starting a “professional” Rails app with Haml, Rspec, Devise, and Web App Theme”

RailsFTW v0.4 released

Rails FTW

Following the release of Ruby1.9.2-p136 source and RubyInstaller, I’ve taken time to update RailsFTW accordingly. Head on over to http://railsftw.bryanbibat.net/ for the latest installer.

Aside from updating the patch level, I’ve also taken time to figure out how to build the mysql2 gem using MariaDB instead of MySQL. Less chance of lawsuits = more fun for us.

As a bonus, here’s a screenshot of RailsFTW showing HAML, rspec, and Capybara working properly on Windows:

ANSICON FTW

I’ll do it once I get [insert awesome hardware/software here]!

In our age of rampant consumerism, it’s easy to fall into the trap of believing that you could only achieve great things only with the best equipment available.

There are two unfortunate side effects to this mentality:

  1. People who can’t get those equipment are discouraged from even trying out that field, and
  2. People who can get those equipment think they’re a lot better than they actually are.

But the reality is you don’t need to shell out tons of cash to be good at what you want to do. Ask any expert from any field, from the arts, to scientific fields, to sports, and they will all tell you one thing: focus on the basics.

Here’s what Freddie Wong (maker of famous After Effects heavy videos like Flower Warfare and Time Crisis) has to say about this:

Continue reading “I’ll do it once I get [insert awesome hardware/software here]!”

“Menial” Labor

sign

My parents don’t get along with me but once in a while some topics come up where I can join in the discussion.

The topic in question was about an aunt worrying about one of my cousins, namely, the lack of direction in his life. He graduated college, but unfortunately failed the board exam. Which is kind of expected: from what I’ve heard, he spends his time just lazing around the house or hanging around with friends (most likely playing DotA). He’s also somewhat spoiled; he only got his OJT work because his mom pulled some strings in her company, and he couldn’t get a job on his own now that he’s graduated (not to mention that his mom even had to accompany him to PRC to see his board exam results ಠ_ಠ).

In short, he’s exactly the opposite of me.

(Well, aside from the lazing around the house part which I did for over a year. But then again, I used my savings then and didn’t take a cent from my folks.)

Anyway, even though I’m usually quiet about these discussions, I couldn’t help but give my (snarky) 2 cents:

“Why don’t they let him apply in McDonald’s or something?”

It was only later that I realized that my suggestion actually made sense.

Continue reading ““Menial” Labor”