Rails Pages

These are the pages that I use with the Ruby on Rails course that I teach. This site provides general background and support materials for anyone interested in learning Ruby on Rails.

Each week there is one lecture, one practical, and one Deliberate Practice Session. The lecture with slides and recordings are in MyAberdeen. You will also find links there to virtual machines in Codio, that have everything installed for you already. You just need to pay attention to the details in MyAberdeen about how to launch the applications there.

The ‘deliberate practice‘ session happens in the second ‘lecture’ each week. Each deliberate practice session is a programming exercise tied to the previous lecture for students to work on in pairs. There is more about this below. The details for each of these will come from my repositories on Github.

The main practicals work through the travelagent application. The travelagent is done in Rails using Ruby 2.6.3 and shows how more complex applications can be developed. You should also look at the Historical Cities application, which shows how to integrate maps, charts, and bootstrap in Rails 6. It should be mentioned that the historical cities application is still a work in progress.

The Lectures and the Deliberate Practice Sessions

These are each one hour long.

Week 1: Introduction   – Story Generator

Week 2:  The Basic Rails app – Temperature Conversion

Week 3:  Rails Databases – Parsing CSV into Models

Week 4:  Database Relations plus Search and Filter – Shopping Exercise

Week 5:  Git and Heroku – Deploy the Shopping Exercise from last week onto Heroku – use Rails Tutorial Chapter 1.5 deploy for details

Week 6:   Assessment Basics (pdf version) – work on assessment

Week 7:  Presentations – both sessions this week

Week 8:  Behaviour Driven Development Testing – A BDD example

Week 9: Authentication Systems   – work on assessment

Week 10:   Security and Web Applications- Explore security issues with the security shopping example

Week 11:  Scaling up applications to work in production – exploring problem sites with the rails guessing game

The Deliberate Practice Sessions

Each of these hour-long sessions will have three coding and discussion cycles: Each cycle consists of 12 minutes of working we’ll stop to discuss how people are approaching the problem, and what they plan to do next. After the final one we’ll wrap up with lessons learned during the session.

During each round we’ll offer a different point of focus for the round so that you are guided in your direction of development. In order to gain the most from these sessions you should not always work with the same person each week so that you benefit from different perspectives on development.

The Practical Sessions

NOTE: You should always type in the lines of code for the exercises below. This is for two reasons. First, you’ll learn more about the ruby language, and rails syntax faster, if you type. Second, if you cut and paste, then you will probably add errors. When this material moved to WordPress most of the quotation symbols were translated incorrectly, so your application will not run.

To fix cut and paste errors, you need to swap the quotation symbols that you see for the correct ones. You can best tell whether it’s correct or not, by looking at your code in an editor with syntax highlighting. If correct, then it should be the ‘right’ colour.

Week 1: Setting up Ruby and Rails for your work. Use any of the 6.x versions.

Week 2: Work on the start of our larger travel agent website. The ‘travel agent’ site builds into a larger Rails application with cross-referenced tables in the database so that we can explore more complex application structures.

Week 3: Start adding some tables and objects in the next part of the travel agent site and enable exception handling, and seeding data to tables for a dashboard with charts.

Week 4: This week we continue with the travel agent site by adding search and customers to the site.

Week 5: We want to be able to use Git  to deploy our applications to Heroku.

Week 6: Work on your assessment

Week 7: Working with Capybara to do tests for system testing in of the travelagent.

Week 8: We should add customer bookings to the travelagent along with more admin support in the dashboard

Week 9: We need an authentication system so we’ll create user accounts for staff as well as a login system.

Week 10: We can now make our system ready for production, and see which security issues the OWASP site suggests we should address

Week 11: We can now tidy up everything and work on your assessment.