Wednesday, September 21, 2011

Rails Editors and the Command Line

One of the first questions you will need to answer when starting with Ruby on Rails, is what editor should you use.  For the mac, it has been TextMate.  I haven't really liked the IDE's for Ruby on Rails (although I never really used them).  So, I needed to find a good text editor for Windows.  Turns out Sublime Text looks like the best one I was able to find.  It works in Windows, Mac, and in Linux.  It is a lot like TextMate, and might even surpass it in features.  I almost switched from TextMate to Sublime, but I didn't because the snippets and plugins aren't quite up to par with TextMate's.  However, if TextMate 2 doesn't come out soon, Sublime will probably surpass it soon.  Must have features are snippets, and a sidebar file browser.  Both TextMate and Sublime have them.  (Of  course if you're a vi or emacs pro, than stick with it.  None of my students are.)  My only question is, should my students pay for it?  I told them they should when they start making money using it.

I also notice that none of my students had any command line experience.  Thinking about it, I had to learn the command line (in Linux) in a Software Engineering class that made us learn Linux and C++ pretty much on our own and then write two substantial programs in C++.  Although frustrating at times, it turned out to be a very good class.  We never teach the command line in any of our classes.  I got a big blank stare when I mentioned make. The downside to only teaching with IDE's.  Luckily, I need to revamp my Operating Systems class.  Maybe I will make it a lot like my Software Engineering class.

Update:
See this post for more information about editors: http://www.christopherslade.com/2011/10/another-rails-editor-and-user.html

Thursday, September 15, 2011

Getting Rails

I am teaching a new class this semester called advanced web application development. The main topic: Ruby on Rails.  A lot of students who have either graduated or couldn't take the course for some other reason wanted to me to make videos for them.  I won't have time for videos, but I will post all the material I use here.

The first step is getting Rails installed.  Most of my students have Windows machines, so the best place to get Rails for Windows would be RailsInstaller.org (I haven't really searched too long, but this seem sufficient).  I wouldn't worry about installing the SQL Server stuff unless you know you are going to use it.  For now, just stick with SQL lite.  You will want Git.  The only downside to all of this is that there isn't RVM, which allows you to switch between Ruby versions and create gemsets.  During the semester, all my student will be using Ruby version 1.9.2, so it won't be necessary for the class.

The next step is to create your first application.  The video on RailsInstaller.org walks you through your first application.  I plan on doing a similar demo in class also using the scaffolding.  After, I will walk students through the code, starting at the routes.rb, then going to the controller, and then the model and view.