CSE 190 M Ruby Sessions

ruby!

If you want to install and run Ruby programs on your own computer, follow our Ruby Installation Instructions. If you have questions about Ruby or any Ruby homework, you can email Kelly or post them on our Ruby message board area.

Session 4: Tying Up Loose Ends

You now have all the information you need to create Rails applications! But the internet is a dangerous place without knowing some of secrets of the trade. This week I'll be teaching you how to incoporate layouts, partials, AJAX, as well as how to write your own gem and what web hosting you can get. Some are for FREE!

Section Materials

Session 3: Scaffolding and Active Record

This week, we will be diving deeper into Rails and learning about the dark, arcane magic of Scaffolding and Active Record.

Section Materials

Optional Homework assignment

Session 2: Routing and Request Parameters

This week, we will be practicing more with routing and request parameters. With any luck, we'll be up to speed with how to use rails just like PHP!

Section Materials

Session 1: Rails - an overview

What exactly is Ruby on Rails? This week, we'll be learning about what it means to develop with a framework, and how it's different than what we've been doing in class with PHP.

This first section will be ripe with coneptual material, as Rails is not a programming language, but more of an organizational system for big web applications. Don't expect to learn much code, but do expect to learn quite a lot.

Section Materials

Debriefing of section

We created a rails application, added a controller class, and gave that controller class a method. That method simply printed out text to a page. This page was then routed through rails so that whenever the user visited the root of the application, it would point to this controller's method call.

Quickly jumping into embedded ruby, we ended up creating a view for the action of the controller class. This view repeatedly created <h1> tags with the content Jay is awesome. Because this method was previously routed to the root of the application, the changes of this view were reflected in the browser instantly! It was like we were editing the index file all along!

Later in the section, we added another route that pointed to the '/extra' part of our application, and it did some simple math expressions and then printed them out

General info about the CSE 190 M Ruby program:

This quarter in CSE 190 M, we will conduct a special optional program to offer students a chance to learn a second programming language as you're learning Java. The second language's name is Ruby.

What is Ruby?

Ruby is a language that's good for writing programs to process text and other data. It's used heavily in the Linux operating system and at companies like Google.

Why would I want to learn Ruby, in addition to Java?

Ruby is used in a lot of other fields and disciplines, so it can be useful to have experience in it. Lastly, Ruby is a powerful language that does a lot of things more easily than Java, so it can be fun rewriting your past Java programs in Ruby and seeing how much shorter and cleaner they can be solved.

What will I do if I participate in this program?

The work involved in this program would be the following:

  • Reading each week's posted links and info for that week's material
  • Completing optional Ruby programming projects each week as desired

Primarily, these projects will consist of solving the same problem as that week's Java programming assignment, but in Ruby, and perhaps with minor modifications to the assignment spec.

What reward do I get for doing this? Do I have to do it?

Participation is entirely optional. The reward for doing these projects will be small, to make sure that Ruby doesn't give students with prior experience an unfair advantage over new programmers. Right now, we're planning to reward students with 1 free late day for each Ruby program submitted. No grade points will be added or subtracted in any way for participating in this project.

How do I participate or learn more?

Just look at the slides and/or links above, and if you find it interesting, try writing the Ruby program for that week. If you finish it, you can turn it in from a link that we'll put up above on this page.

Valid XHTML 1.1 Valid CSS! JavaScript Lint