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.
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!
This week, we will be diving deeper into Rails and learning about the dark, arcane magic of Scaffolding and Active Record.
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!
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.
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
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.
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.
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.
The work involved in this program would be the following:
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.
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.
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.