[Follow Up] Styling the Sign-up form in Web App Theme

Two days ago, a reader emailed me asking for help on my previous tutorial. There I was able to convert Devise’s sign in form to use Web App Theme’s CSS, but I didn’t provide details on how to style the other form: the sign-up form.

The change required is pretty simple actually, just as long as you understand what I did in that tutorial. First, you need to tell Rails to override Devise’s RegistrationsController’s layout to use the “sign” layout (just as what we did with SessionsController which handles the sign in):

    config.to_prepare do
      Devise::SessionsController.layout "sign"
      Devise::RegistrationsController.layout "sign"
    end

Then modify the app/views/devise/registrations/new.html.haml file accordingly. If all goes well, you should get something like:

sign up page

The steps to convert the “Forgot your password?” page is left to the reader.

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”

Upgrading Telefonica's P-660HW-61 firmware

upgraded firmware

Some of you might realize that while the modem works properly after following my previous post, you can’t upgrade it using the original firmware from ZyXEL. Repeating what I said in the original post, you can’t upgrade the firmware to use the official ZyXEL version because of the built in firmware.

For those of you who have some electronics experience a lot of time to spare, I’ve summarized the steps on how to change Telefonica’s P-660HW-61 firmware to ZyXEL’s original version.

Note that in the steps below, you will void your warranty and you may brick your device. I am not liable for the damages caused by this post.

FYI, I bricked my modem in my first try. You have been warned.

Continue reading “Upgrading Telefonica's P-660HW-61 firmware”

Using CD-R King's Cheap Modem/Router

CD-R King's ADSL Kit

At PhP 880, CD-R King’s ADSL kit is the cheapest modem/wifi router you can find in any store right now. Problem is, it won’t work out of the box for most people.

This post will explain how I replaced my PLDT DSL modem + D-Link wifi router setup with this unbelievably cheap device.

Continue reading “Using CD-R King's Cheap Modem/Router”

Collaboration with Revision Control

The problem to avoid

A group who codes programs without revision control is stupid. And crazy.

Seriously, what self respecting software developer in 2009 in their right mind would use a “shared network folder” approach in sharing code instead of opting for a VCS?!?!

Here we come to the second important purpose of revision control, namely, to automate most of the processes involved in sharing work among multiple users. Those processes and the problems involved with them are neatly described in the SVN book. Just click the link and come back here when you’re done reading the chapter (saves me the copy-paste effort :P ).

Continue reading “Collaboration with Revision Control”