Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Apple Publishes Ruby On Rails Tutorial

Posted by ScuttleMonkey on Tue Feb 28, 2006 06:22 AM
from the big-pictures-that-ever-your-manager-can-understand dept.
bonch writes "Apple has noticed the high amount of Mac usage in the Ruby on Rails community and has posted an illustrated Ruby on Rails tutorial. The document goes into more concise detail in getting new users up to speed, from database schema to moving beyond scaffolding, all done with the favored Rails editor, Textmate."
+ -
story

Related Stories

[+] Ruby on Rails 1.0 Released 332 comments
Simon (S2) writes "Ruby on Rails 1.0 has been released. From the announcement: 'Rails 1.0 is mostly about making all the work we've been doing solid. So it's not packed with new features over 0.14.x, but has spit, polish, and long nights applied to iron out kinks and ensure that it works mostly right, most of the time, for most of the people.' " The Ruby on Rails website has also been given a new look.
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • Jobs: Ruby is groovy man. It's got like, vibe. We had to get in on that.

    Gates: C# with .NET offers more flexibility with less development worries and higher performance...

    Jobs: Man! Talk about Squaresville! Ruby is hip man! It's a love machine. A child of the earth.

    Torvalds: Ruby is based on perl, which is in turn based on bash scripting, which I like.

    Jobs: You see man! Ruby is a free spirit. It grows in like, the sunshine. It doesn't obey your rules!

    Gates: But it's just another paradigm. .NET can accomplish all the same....

    Jobs: On Rails man! Rails!!! It's like hyperspeed into the cosmos. And that's why its fit for Apple's attention. Now if you'll excuse me, I have to go get some podcasts over rss, browse some blogs, do some yoga. You dig?

    ***Jobs walk's away clicking fingers rhythmicly***

    Gates: But it's all just flash and hype. Nothing really new is going on! .NET does all this! Why won't anyone listen? You believe me right?

    Torvalds: Look man. I really just don't give a shit.
    • Re:Ruby Is Groovy (Score:2, Insightful)

      by Anonymous Coward
      .NET's ORM system is nowhere near as complete or useful as the one in Rails... You're kidding yourself if you think otherwise (and yes, I have tried development in both systems and Rails beats .NET hands down)
      • .NET's ORM system is nowhere near as complete or useful as the one in Rails... You're kidding yourself if you think otherwise (and yes, I have tried development in both systems and Rails beats .NET hands down)
        dude, read closer, it's Bill Gates that's kidding himself
    • Re:Ruby Is Groovy (Score:3, Insightful)

      by k2r (255754)
      > Ruby is a free spirit. It grows in like, the sunshine. It doesn't obey your rules!

      It's more like "Ruby doesn't get in your way!" as Rails dosn't do (most of the time) and OSX avoids to do quite successfully , too.

      Chunky. Bacon.
      k2r
    • Ballmer: (Throws a chair)
    • But have you ever seen Ruby on Rails... on weeeeeeed?
      • Something like ruby is what apple needs to compete with .net.

        It is not like there is only room for a single programming language on a platform...

        Besides, Apple already uses Java, for instance it built the highly successful WebObjects [apple.com] around it. If, against all odds, .Net would completely wipe out Java there is always Mono.
        • WebObjects wasn't built around Java, or even on top of it. It was ported to Java after being written in Objective C.

          However your point still stands, there are many frameworks to choose from on both platforms, there doesn't have to be One True Way, in fact, it's harmful to think that way.
      • Ruby -- A pretty cool scripting language.
        Ruby on Rails -- A pretty cool web applications framework using Ruby .NET - A complex framework unifying a virtual machine written in a functional programming language (CLI) with the interpretive frameworks that most programmers are familiar with (language specific compilers). Ships with a complete IDE, hundreds of low level OS functions, implementations for some of the popular programming languages, a full set of widgets covering graphics, database access, networki
      • Something like ruby is what apple needs to compete with .net.

        Sorry, I was a bit quick to answer in my previous post, I completely missed you point. Here comes second try:

        People who like Apple are hardly going to be swayed to PCs by .Net of all things. There are plenty of programming environments both for desktop apps and enterprise things, such as Objective C, Java and others.

        Neither are .Net developers likely to swarm to Macs because of Ruby.

        So while Ruby for Mac is a nice thing by all means for Mac devel
      • That's interesting. First you attempt to attack a platform (the one under topic naturally), and then immediately attack the users of that platform before they can place any defense as, you know, a second opinion on why they may disagree with you. You even attack the fact that they might disagree with you in a way that makes any sort of defense appear as though they are just spouting out fanboi flames.

        Instant defense without even an attack, such as what you have shown here, really makes one wonder if their
  • ...to delve into Ruby. I was kind of tired of trying other tutorials (mainly from the internet) as I fouind them incomplete and sincerely wanting. Thanks to slashdot for the link.
    • I was kind of tired of trying other tutorials (mainly from the internet) as I fouind them incomplete and sincerely wanting.

      Did you see Programming Ruby: The Pragmatic Programmer's Guide [rubycentral.com], by Ruby's creator Yukihiro Matsumoto? It's a freely-available transcript of a paper book, and I'm halfway through and finding it good going.

      Now I'm only playing with Ruby at the moment, so I couldn't say how the examples and sections stand up to heavy industrial use, but if seems an excellent introduction and the tone an

  • Hey, I hear Baskin Robins is coming out with a new ice cream this month, "Ruby."

    This month only though, flavor of the month. Next month they're doing AJAX.

  • According to Apple's article:
    The version of Ruby that ships on Mac OS X Tiger is 1.8.2, but it doesn't work well with Rails. So you'll need to upgrade your Ruby installation as well as install a newer version of Rails (as of this writing, use version 1.8.4).
    So my question is: if Apple thinks Ruby on Rails is such hot shit, why doesn't they just upgrade their version to 1.8.4 via Software Update?
    • by skribble (98873) <scott@@@mydogateit...com> on Tuesday February 28 2006, @07:45AM (#14815697) Homepage
      So my question is: if Apple thinks Ruby on Rails is such hot shit, why doesn't they just upgrade their version to 1.8.4 via Software Update?

      Because it's probably not fully tested to work with Tiger. The only system updates you get with Software Update and bug fixes and security fixes. Occasionally you'll get something else which works behind the scenes with an updated iApp as well (there have been minor CoreImage and other framework pieces updated this way).

      This is just good sense, it's stability vs. cutting edge. Also it can be a very bad thing to update the system incrementally (Ask Microsoft who have been bitten by this many times... often updating one thing can have unexpected results on others.

      Also, for a developers interested in using Rails, updating Ruby is fairly trivial. I would also add that often even if Apple includes the latest version of something you may want to compile it yourself anyway (Apache, PHP. MySQL are good examples of things that people will often *upgrade* right out of the box).

      • I have been going to WWDC for three years now. Every year during the feedback sessions people always ask the same things.

        1) How come you hate webobjects developers so much.
        2) When are you going to get a decent package management tool or formally adopt darwinports.

        Every year the answers are the same.

        1) We don't really hate you guys, we really love you, we neglect webobjects on purpose.
        2) We are apple, neither darwinports nor pkgsrc, nor fink is good enough for us. One day we will write a really cool one just
    • Here's a tutorial for getting a completely self contained Rails dev environment ready to go on OS X, without having to worry about the default OS X Ruby install not supporting Readline and such.

      Ruby on Rails, Lighttpd, MySQL on OS X Tiger [hivelogic.com]

      It's also a good tutorial for learning in general how to get the development tools you need and compiling them from source into /usr/local/

    • Because later in that same paragraph:

      It starts by installing Ruby 1.8.4 without overwriting the system-installed Ruby (it puts the new version in /usr/local). That way, the default system works as expected for other users or programs already coded for the system-installed ruby.

      Now if you'd asked why 1.8.4 might break things expecting 1.8.2, that's another question :)

      Mark
    • There's something wrong, somehow, about the notion that a "mature" framework requires the absolute bleeding edge version, such that 1.8.4 works and 1.8.2 doesn't.

      Mind you, it could just mean there's a bug in 1.8.2/.3 that happened to break RoR, so I'll reserve judgement.

      Is Ruby "stable"? That is, is it still under intensive development or are we looking at minor upgrades to fix bugs and such in the implementation?

    • ... the majority of Apple users don't care about Ruby or Ruby on Rails, so there really isn't a reason for a Software Update upgrade that only .5 % (maybe less?) of their users want. For those that do care (such as myself) it's a relatively painless upgrade doing it yourself.
  • by MrByte420 (554317) * on Tuesday February 28 2006, @07:35AM (#14815666) Journal
    The authors of rails books need to stop writing tutorials and write some comprehensive documentation. Even the page is quite lacking. [rubyonrails.org]

    For example, suppose you have a time field, not a date field, no year, just time. And you want to create that element in your webform.

    If it were date, you'd use date_select, pass it the name of the object and the name of the field, and your done, you get a nice input box. Suppose you want the same thing for time, its still date select with a series of discard attributes, e.g.

    date_select('meeting','starttime', :discard_year => true)

    However, you as the person looking for the documentation for this are led on somewhat of a goose chase becuase your time input box information is not even close to what you'd expect (time_select perhaps?) and you should be looking under "date" for "time".

    (Incidentally, Rails 1.0 has a bug where it seems to ignore :discard_year so the whole exercise is quite fustrating when you do find the docs, but i can live with bugs that will be fixed)
    • The authors of rails books need to stop writing tutorials and write some comprehensive documentation.

      This is what pushed me away from Rails not long after I started looking into it. Aside from API guides and the like, all real documentation on Rails and Ruby is outdated or sparse. Sure, there are lots of Rails tutorials out now, plus there's Why's Poignant Guide, but these alone are not nearly enough. The RoR community's answer is, of course, to simply buy the Programming Ruby and Agile Web Development wit
      • Don't get me wrong, the pragmatic progarmmer's book is pretty good, but its sparse in many parts.
          • I don't know what to tell you. I guess ROR isn't for you. Maybe try PHP, there is a lot of documentation there. I was going to say try zope but it's even harder and the documentation is even more outdated.

            I guess there is always java. Lost of documentation there if you want to spend all your time typing everything three times.... Customer myCustomer = new CustomerFactory.createCustomer("joe").asCustomer()

            Whatever you do stay away from perl though, that way lies madness.
      • MySQL has a time type. Besides, why does this have to be so difficult. I spent an half an hour on this little conquest for something that I should find an answer for in the index. I was writing a script tracking portal, I really didnt' want datetime, I just wanted time. And I certainly didn't want datetime in my input...
  • As noted on the Ruby on Rails weblog, the author is Mike Clark, who is fairly involved in the Rails community. He's not an Apple employee though. The ADC article just doesn't have his name on it, so it mistakenly seems like this tutorial came from within Apple.
  • The tutorial is concise and clean - a must for folks like me that don't have tons of time... I appreciate the post to ./ about this... my son has been asking about Ruby, and neither he nor I have had time to do anything with it at this point.

    I agree that the article should be attributed. It's important to give credit where credit is due. It's also interesting that the article mentions http://macromates.com/ [slashdot.org]">TextMate. TextMate is a nice concept.

    Simple tutorials like this are critical to the adoption
  • Hey Ruby/Rails users...giving you a chance to evangelize. I've never used it, but to me, it almost seems like a framework designed to make quick demos, but every demo I have seen is completely lacking in any design or uniqueness.

    So, my question is this: how easy is it if you want to have a more complex visual layout? What If I want a form to submit to an encrypted text file? What if I need to work this system into a very intricate design?

    What I'm trying to get at is: does its simplicity w/r/t getting s
    • Give it a try and you'll find it can meet just about any needs. The HTML templates are something like JSP where you drop your data into an HTML page, so there is no limit on RoR site designs.

      You'll find that most of the time Rails' data handling makes your life much easier than other frameworks. When Rails doesn't quite make the right decisions about your data you can always override the default functionality with the same or less work than would be required using other frameworks.

      In my opinion, Rails is a
  • by YetAnotherName (168064) on Tuesday February 28 2006, @08:46AM (#14815997) Homepage

    See also this screencast [nasa.gov] for a comparison of Ruby on Rails, Zope (Plone), TurboGears, and Django. Oh, and J2EE which fares ... rather poorly in my opinion.

    Warning: the screencast is 36 minutes long!

    • Can you expand your point about exposing too much SQL? My worst experience with a framework was with J2EE entity beans (EJB ver. 2.0.) - the persistence layer that tried to hide the SQL only to reimplement it totally half-assedly. The EQL sucked a big time:

      - no mass updates/deletes.
      - no aggregation (count,max,min,sum)
      - no dynamic queries
      - restricted joins
      I've heard they fixed it to some degree in EJB ver. 3.0, getting it close to the actual SQL expression power.

      Do you know a persistence framework

  • This may be a dumb question but...

    Everything I'm seeing about Ruby on Rails says it's great for making "Web Applications". I'm going to start designing a new dynamic website soon, and I was wondering about building it using RoR.

    I just want to use CSS, and plug the whole thing into a database.

    So are they just buzzwording me, or is RoR the wrong tool to use for something like this?
  • I'm going gung ho into RoR. I've bought the book from the Pragmatic Studio. I've bought TextMate. But I continue to hit a dead end. And its not getting away from scaffolding. No it comes down to an admin interface. RoR needs one desperately. And now. Django has one built in. Every tutorial on Rails is basically a one table tutorial with an occasional lookup table thrown in. Please somebody point me to a comprehensive step by step tutorial that details the creation of an administrative side of a we
  • by Qbertino (265505) on Tuesday February 28 2006, @08:57AM (#14816056)
    Hey, Guys! Get with the programm. Ruby on Rails is so last-season.
    Django [djangoproject.com] is where the musics at. And for good reasons too. It's more mature, easyer to use, faster in developement, less performance hungry, has a documentation that's up to date and has a grown up backend kit. It's only that they GPLd it last summer, that's why it hasn't gotten all the press yet.
    And this is not to start a flamewar. Compare them both and you'll see what I mean.
    The RoR and Django guys are good friends btw.
  • no Locomotive love? (Score:3, Informative)

    by cygnus (17101) on Tuesday February 28 2006, @11:45AM (#14817525) Homepage
    i'm kind of bummed that they didn't mention Locomotive [raaum.org], which really makes getting started with Rails very very easy. it seems like every Rails tutorial starts with "OK compile Ruby, install Gems, install Rails, install and configure MySQL, and 10 hours later, you can use this really simple framework!" when with Locomotive and SQLite3, you can basically just download one app, click two buttons, and start typing.
  • WebObjects (Score:3, Interesting)

    by macserv (701681) on Tuesday February 28 2006, @02:40PM (#14819618)
    I don't understand why someone would want to use Ruby on Rails on Mac OS X, when WebObjects comes with the developer tools, is an enterprise-class Java app server, and is way faster in both development and deployment (on Mac, Windows, Unix, or Linux) than anything else I've seen.

    It really is the best kept secret in the web app world. If you've not tried it, you might want to give it a shot.
    • That was Lufia 2! Although in the original Lufia you needed to find a Ruby to get through the three towers puzzle.
        • Don't be so quick to pass up some fantastic lesser known games such as Paladin's Quest, the innovative control system and illegible item names as well as the difficulty and the HP based magic system made a lot of casual gamers pass it up, but if you can get your hands on it it's one of the most fun and challenging RPGs for the SNES
        • very annoying to users yet the darling of developers?

          Only those developers who can't see that a tight coupling between your code and your database is not a good idea.
    • Re:Looks interesting (Score:3, Interesting)

      by lennart78 (515598)
      I've been spending quite some time working on it on an OS from Redmont. I'd reckon the experience can be compared to that on any *NIX/BSD you prefer.

      The main things I have to say about tools is: I haven't found the right tool. Yet.

      The scintilla-based editor that comes with rails is ok, but no more than that. I'd prefer an IDE, with some project management and such. It seems like there are some possibilities with eclipse. http://www.napcs.com/howto/railsonwindows.html#_To c111133460 [napcs.com]

      But I still have to check
    • Umm, the guys who write Web development tutorials for Apple are probably not the same guys that code the OS and applications. This tutorial wasn't actually written by Apple, they are just distributing it. You know the guys in finance are still working on accounts and haven't stopped to try to fix bugs in code either. I've been annoyed by Apple's weird handling of metadata versus extensions since they announced it but you are way off base in complaining about this as if it had some relation to security issue

    • I'm in the middle of writing a fairly substantial website in Rails. The first iteration of the site, everyone could do everything to every bit of data. The second version? I added one line of code to the parent of my controllers:

      before_filter :authorized? :except => ['show', 'list', 'index']

      The authorized? function redirects users to the login page if they're not already logged in. So the result is, it's trivial to add validation code before every single action that makes changes to the database. If