Slashdot Mirror


Part 2 of Ruby on Rails Tutorial Online

An anonymous reader writes "Curt Hibbs has released Part 2 of his tutorial Rolling with Ruby on Rails to the O'Reilly ONLamp site. The first part was published in January. Topics covered are database transactions, callbacks, unit testing and caching." From the article: "In Rolling with Ruby on Rails, I barely scratched the surface of what you can do with Ruby on Rails. I didn't talk about data validation or database transactions, and I did not mention callbacks, unit testing, or caching. There was hardly a mention of the many helpers that Rails includes to make your life easier. I can't really do justice to all of these topics in the space of this article, but I will go into details on some of them and present a brief overview of the rest, with links to more detailed information."

7 of 187 comments (clear)

  1. Rails and other Rails tutorials by teidou · · Score: 5, Informative

    To explain Ruby on Rails, I could say it is a highly integrated model-view-controller type web application framework. That would be like saying a Ferrari is a 4 wheeled internal combustion vehicle: true, but misses the point.

    For more info, see RubyOnRails.com. An good alternative tutorial is at http://rails.homelinux.org/.

    There are even better introductory materials coming. Dave Thomas (of Pragmatic Programmers) is working on a Rails book, chapters are being reviewed presently.

    Rails is powerful an flexible. More importnatly, it's a lot of fun. If you are a programmer who want to enjoy web-based application development, please do take a look at Rails.

  2. One thing has changed... by WWWWolf · · Score: 4, Informative

    When the part one was published, I had severe problems getting Rails to work in Debian. There was a lot of really odd tools that needed to be installed and all that. Rails web page had tons of Ruby packages that I was pretty sure I didn't need...

    But one thing has changed since then: Rails is now in Debian unstable!

    1. Re:One thing has changed... by Tobias+Luetke · · Score: 4, Informative

      Please don't make this sound like an rails or ruby issue. Debian really blew it on packaging ruby. Most of the system related problems which come up in #rubyonrails are related to debian linux installations.

      How did they come up with the brilliant idea to split the standard library into 34 different packages? I just can't see how something moronic like this can even get started considering that a standard library is all about raising the status quo of the language by providing some shoulders to stand on so people can reach for higher goals.

      Keep in mind that ruby has no dependencies at all. All dependencies are optional and the libraries using them (tk,x11, readline) fail gracefully with exceptions when the parts are not installed. Not so if the entire library is missing, this will cause a runtime exception with cryptic error message which rails will never be able to handle. Also ruby is tiny the entire package is 3mb!

      I heard they are talking about improving the situation by adding a "virtual package" for ruby which contains all 34 seperate packages

      Future in Debian terminology is traditionally not soon and thats a fix feeble fix considering all they need to do is to put all 3mb of ruby in one package

      Anyways the point is fairly moot now since debian doesn't have ruby 1.8.2 anyways which is required for the latest rails

      Luckily its easy to install ruby by hand. And I heard gentoo and freebsd install pretty easily too...

  3. Re:Any interesting projects? by elmartinos · · Score: 5, Informative
    Shure! Even though Ruby on Rails is really very young, there are a few commercial sites that use it already. Here are a few links: Although, the first 3 links are somewhat related.
  4. Re:Sounds exciting... by rubycodez · · Score: 5, Informative

    No way this framework will replace existing java frameworks

    There is actually a chance it may become a mainstream way of building an enterprise framework. There is a very cool new bytecode Ruby virtual machine and just-in-time compiler (YARV), and the next generation of Ruby, Ruby 2, will support native OS threading. Unlike Java, the source for Ruby is and will be completely open & transparent. Ruby can run on platforms where java can't, like BeOS and MS-DOS.

  5. Agile Web Development With Rails by Ridgelift · · Score: 4, Informative

    Dave Thomas' new book "Agile Web Development With Rails" is due out in July. It's really, really good so far (I'm one of the lucky ones who is helping review it). My perspective is a person who knows very little about databases, web application development and no previous knowledge of Ruby, the language that Rails is built on.

    One of the big problems with Ruby on Rails is that it is well documented, but a lot of it is API's and reference documentation. Dave's new book has an excellent tutorial which is the best thing I've seen written so far about RoR for newbies, and promises to go into the depth and detail similar to his Pickaxe book.

    If you've previously looked at RoR and were disillusioned because you just weren't "getting it " or didn't want to slug through the technical documentation, I encourage you to keep an open mind and wait until Dave's book is released. I'm finally getting over the hump with RoR and I now see what all the fervour is about.

    (Oh, don't ask me to post or send copies of his drafts, 'cause I ain't gonna!)

  6. Re:Python Version of RoR by Paradox · · Score: 4, Informative
    I can't impress you, sorry. But I can say that Ruby blocks are a powerful tool that are very flexible and useful. Ruby iterators are the showcase of this tool, and they're something you use every day in ruby. For example:
    ary = [1,2,3,4,5] # Example Array
    ary.each do |val| # Begin a block
    puts val.to_s + " was here!"
    end
    Blocks can be used inline as above, or turned into true closure-bearing functors like so:
    my_block = lambda { |x| puts x.to_s was here }
    my_block.call "Kilroy"
    ary = [1,2,3,4,5]
    ary.each &my_block
    You can write higher order functions that accept lexical blocks trivially. For example:
    def my_hof( &block )
    yield # Calls the associated block within scope
    block.call #Calls the associated block as a function
    end
    Also, ruby's blocks are used to do neat things like ensure things happen at the end of an operation. File I/O is the classic example. Check out how Ruby's library ensures your file closes:
    File.open( "somefile.txt", "w" ) do |handle|
    handle.puts "This is text in the file."
    end # File is ensured to be closed now
    This is just a small sample of what Ruby's standard lib does with blocks. They're really quite useful. They're like Lisp's lambdas but with a cleaner syntax when used inline.
    --
    Slashdot. It's Not For Common Sense