My First Rails App

After completing the very comprehensive and freely available Hartl Rails Tutorial, I decided to quickly put together a super simple Rails app to revise the basics.

I mostly wanted to practice setting up a new Rails app and deploying it to Heroku. I could have done this with the standard Rails template application, but wanted it also to be something useful.

Over the course of a couple of hours last night (most of it spent rediscovering relevant commands in my notes, or Googling a weird bug) I created a Property Yield Calculator.

yield calculator

It’s only a single static page, but it’s using a StaticPages controller rather than just delivering a pure HTML file.

It was easy enough to pickup enough Javascript to do the yield calculation and number formatting (thanks, JQuery!), but even with Bootstrap it took quite a while to get the CSS into a state that I was happy with.

In the end I’m pleased with the result. It may be just a single static page, but I developed it from nothing in Rails and I’ve already found at least one person who finds it very useful.

What did I learn?

  • Using routes and controllers to deliver static pages
  • Responsive design (to an extent). The design adapts fairly nicely to screen size and the ‘How to use’ box isn’t shown at all on small screens
  • Heroku idles a single dyno app after a short time, so it may take 10-15 seconds to load an app

The source code is freely available to use and adapt on Github

One thought on “My First Rails App

  1. Pingback: Rails is starting to make sense | Jayrobin

Leave a Reply

Your email address will not be published. Required fields are marked *

*