Information technology tools and resources at the UW
Ruby on Rails
What is Ruby on Rails?
“Ruby on Rails is an open source framework that’s optimized for programmer happiness and sustainable productivity. It let’s you write beautiful code by favoring convention over configuration” – rubyonrails.org
Ruby on Rails takes the role of languages like PHP and ASP.NET MVC to provide a framework that allows web programmers to write servers that host their websites. Rails powers mainstream high traffic web applications like Twitter, Twitch.tv, GitHub, GroupOn, Hulu, PennyArcade.com, Basecamp, and plenty more.
In order to walk through the curriculum you will need to setup some tools on your computer. These tools are free.
Rails Installer – Runs on Mac OS X and Windows
Simple step by step installer with everything needed for Rails development.
Komodo Edit – Runs on Mac OS X, Windows, Linux
Allows us to write code much more efficiently by highlighting the syntax we will discuss throughout the curriculum.
Chrome – Runs on Mac OS X, Windows, Linux
Modern web browser that will allow us to preview and debug our content
This tutorial was created by rubyonrails.org the official website of the Rails framework. This ensures the material stays up to date and is as accurate as possible. It is designed to be read through step by step.
Brief outline of the assumptions made by the guide.
What is Rails?
Explanation of principles behind rails. Skim lightly and refer back to this throughout the guide to understand the terms and theory behind each step.
Creating a new rails project
Creating the file structure, using rails generators, to store and run our Ruby on Rails code.
Displaying text with rails on a web page by generating a controller, modifying a view, and running the rails project.
Getting Up and Running Quickly with Scaffolding and Creating a Resource
Guide to making the best of scaffold code generators and an introduction into RESTful resources by generating blog resources.
Adding a Second Model
Adding comments to our blog by generating a comments model and working closely with controller routing.
Simplifying and consolidating our views by utilizing view partials.
Using ActiveRecord to manage our database using native ruby objects
Building a Multi Model Form
Creating a Tag model to allow our posts to be tagged and using the form builder with multiple models.
Securing sections of our blog from the public with the built in http_basic_authenticate_with function.
Creating helper functions to consolidate and clean up code used in views.
Catching some of the common encoding errors when developing with Rails.
Frequently Asked Questions
These questions are meant help you solve specific but common problems that may pop up when using this language. They are meant to be read after you have gone through the tutorial and begin actual development.
How can I put my Ruby on Rails application on the web?
There are numerous options for hosting Ruby on Rails applications due to it’s recent boon in popularity and usage. Below are what this author thinks are some of the best hosts.
If you are a University of Washington student, staff, or faculty you can follow the UW IT Connect tutorial for setting up your Ruby on Rails application for free on UW servers.
If you want a free, easy to use, but very limited host than you can try using Heroku. They also have a step by step tutorial for uploading Ruby on Rails applications. You can pay to host with them for premium features, but that can get rather expensive.
If you want a paid host that has high performance and scalability, but requires extensive knowledge of virtual servers than you can try using Amazon EC2.
Why use Rails over other widely used server side technologies such as PHP?
Rails favors a “convention over configuration” approach to software development meaning that you are forced to structure and do certain programming tasks following a single Rails convention as opposed to deciding project by project. This principle enforces best practices in software engineering even for beginners as opposed to languages like PHP which allow beginners to fall into preventable programming pitfalls. If you are interested in more reasons why check out the following link.