Slashdot Mirror


Ruby On Rails Goes 1.1

MrByte420 writes "The Ruby On Rails team today released version 1.1 of the web framework. From the announcement: 'Rails 1.1 boasts more than 500 fixes, tweaks, and features from more than 100 contributors. Most of the updates just make everyday life a little smoother, a little rounder, and a little more joyful.' New features were examined back in February at Scottraymond.net and include Javascript/AJAX integration, enhancements to active record, and enhanced testing suites. Not to mention upgrading this time promises to be a piece of cake."

43 of 255 comments (clear)

  1. Re:Getting started by Noer · · Score: 4, Informative

    First, despite what some people say, I think you really have to learn the Ruby language first. Yes, you can get by coding 'by rote' but a deep understanding of this really elegant language will help a lot. Second, there are some great tutorials at the Ruby on Rails site but I think the best is the Agile Web Development with Rails book, though it hasn't yet been updated with the new Rails 1.1 features.

    --
    -- "Those who cast the votes decide nothing. Those who count the votes decide everything." -Joseph Stalin
  2. Re:Getting started by Anonymous Coward · · Score: 2, Informative

    Programming Ruby - a free ruby eBook - http://www.rubycentral.com/book

  3. Re:Getting started by BioCS.Nerd · · Score: 5, Informative

    This is a good place to start: http://poignantguide.net/ruby/ and then perhaps this: http://www.pragmaticprogrammer.com/titles/ruby/ (Either one is good -- I used the latter)

    Or, if you're on the lazy side of things, you can try it right within your browser here: http://tryruby.hobix.com/

    I hope this helps.

  4. Re:Getting started by gavri · · Score: 2, Informative

    The book is Programming Ruby. That's the second edition.

    The first edition is available online. You don't need to buy the second edition unless you are really serious about learning Ruby. The first will do for evaluating the language and playing around with Rails. And if you really want to learn Rails (after going through the tutorials), Agile Web Development with Rails is the book I recommend.

  5. Javascript is insecure - AJAX is security hole by billstewart · · Score: 3, Informative
    Sigh. Rails is joining the list of things that encourage people to use Javascript applications, just as all the AJAX stuff does. So anybody who's using those applications has to toast their security.

    The problem isn't that you can't write secure Javascript code - you can. The problem is that if anybody wants to *use* your nice secure AJAX/RAILS/etc. application, they need to turn Javascript ON in their browser, which means they're vulnerable to maliciously-written Javascript on any other web pages they visit.

    There's no easy way around the problem if you want to run the new cool AJAX applications, and there's a lot you can do with a programming model that makes it easy to distribute functions between the client and the server. For Mozilla users, it's probably possible for somebody to implement per-site permissions for Javascript the way they do for cookies, images, etc. For IE, though, you're just toast.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
    1. Re:Javascript is insecure - AJAX is security hole by gregarican · · Score: 5, Informative

      Ever heard of using the Trusted Sites list in Internet Explorer? seems to work for me for per-site permissions.

    2. Re:Javascript is insecure - AJAX is security hole by ceejayoz · · Score: 4, Funny

      And images expose you to things like the WMF exploit, so let's just go back to the 1980s of web design.

    3. Re:Javascript is insecure - AJAX is security hole by nuzak · · Score: 2, Informative

      Out of the box, rails doesn't add any javascript at all. The fact that when you do use the javascript generation, the fact that it's so closely tied to prototype .js is my main problem. Got a method or attribute called "extend"? Too bad, prototype owns it. Nice use of namespaces, fellas.

      --
      Done with slashdot, done with nerds, getting a life.
    4. Re:Javascript is insecure - AJAX is security hole by TodLiebeck · · Score: 2, Insightful

      First let me say that I'm the lead developer of Echo2, which absolutely requires JavaScript in order to function, so please take that into account as a bias if you desire.

      I disagree with the statement "JavaScript is insecure". Implementations may be insecure, but the specification itself has no such problem. There have certainly been security holes discovered in JavaScript implementations. There have been equally dangerous security holes discovered in other aspects of the browser.

      My other question to the "disable JavaScript" camp is, "what do you propose as an alternative?" Flash, client-side Java or any similar technology has the same security concerns as client-side JavaScript. The answer of "just use plain HTML" is not a solution. JavaScript and this "AJAX" stuff is not just about adding bling to applications--it's about eroding the barrier between remote and desktop applications.

  6. Re:Getting started by gavri · · Score: 2, Informative

    I'm not sure what you mean by a website that can show off what the language can do. Ruby, the language is independent of the Ruby on Rails framework.

    But if you do mean that you want to see Ruby executed, an online interpreter is available.

    If you're asking for examples of what Rails can do, it can do only what you can do using any other language on the server-side, only much faster and with cleaner code.

  7. Rails is Great by nashjobs · · Score: 5, Interesting
    It allowed me to develop this job website in 2 1/2 months spare time with 400 unit/functional tests. I was a Java programmer, and now there's no going back ;-)

    Any other former Java programmers relate?

    1. Re:Rails is Great by Anonymous Coward · · Score: 2, Insightful

      I am still a java developer until someone starts to pay me to do rails fulltime. But, yes, I am doing rails in all my consulting and side work now...as well as all my personal apps. So, java still pays the bills but ruby/rails is the way of the future for me.

      I equate it to the java transition that happened some years back....i have to still do java until the industry starts to realize the power of rails, just as I had to do C until they started to use Java.

    2. Re:Rails is Great by StarvingSE · · Score: 2, Funny

      I see your site says beta, are you a former google employee?? ;)

      --
      I got nothin'
    3. Re:Rails is Great by catch23 · · Score: 2, Interesting

      One thing I like about Rails (or Ruby in general) is that you can have a relatively short turn-around time since Ruby is interpreted. In the old Java & Hibernate world, I'd have to run xdoclet for every new field in the database, re-compile with javac every time I added more functional code (either in the model or controller), or reload tomcat every now and then.

      However with Ruby + Rails + Ruby & Rails Eclipse plugins, I almost never need to sit around for more than 2 seconds to see my generated output. I can quickly make a quick modification in model code and immediately see the effect by pressing the reload button on the web browser. I'll also say, the default debugging output of Rails is a lot easier to read than the default debugging output generated by Tomcat & faulty jsps.

      After working with Hibernate for a good 3 years, I can say that it is sometimes nice to develop your database schema first rather than develop object mappings that will generate the schema. The whole "automated naming convention" also removes the possibility of a neophyte programmer to come along and create some ugly get/set methods with side effects.

  8. Looking to get started in Rails? by RunFatBoy.net · · Score: 4, Insightful

    Along with the API documentation, I found the book "Agile Web Development with Rails" highly beneficial. For a while there, it was the only definitive, concise source of Rails examples.

    Even if you're skeptical of the Rails hype, I encourage any developer worth their salt to sit down with it for a weekend. The whole concept of convention over configuration can be a bit mind bending, especially if you're use to Java's XML hell. It's always beneficial to force your brain to adapt to new languages; it encourage contrarian thinking when considering new solutions.

    Jim http://www.runfatboy.net/ -- Exercise for Web 2.0.

  9. Web an API junkyard by amightywind · · Score: 3, Interesting

    This posting only serves to remind me what an API junkyard web programming has become. Let's see, we need server side Ruby to transmit and execute Javascript that manipulates a DOM to emit HTMP, gracefully degrading features for anachronistic browers. Zowie!

    --
    an ill wind that blows no good
    1. Re:Web an API junkyard by Overly+Critical+Guy · · Score: 3, Interesting

      Aaaaaand how is that different from desktop development? Actually, how is that different from any other development?

      Yeah, shocker, APIs call other APIs to call other APIs. That's how software works.

      All you did was describe the basic model of server code delivering client code. Which is the future.

      --
      "Sufferin' succotash."
  10. Re:Upgrading by metamatic · · Score: 3, Informative

    The OS X problem is that Apple shipped an old and somewhat broken version of Ruby. I'm sure that now that Rails is getting more attention, that will be fixed in the next release of OS X... Ocelot or Liger or whatever it is.

    http://developer.apple.com/tools/rubyonrails.html

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  11. Re:I haven't heard much by Anonymous Coward · · Score: 2, Funny

    Nobody. They're all to busy hyping it and posting on slashdot about how great it is. Meanwhile all us PHP/JSP/ASP/whatever programmers are off actually making web applications.

  12. This seems good for layman understanding by AgNO3 · · Score: 5, Informative

    http://developer.apple.com/tools/rubyonrails.html Found that link on the ruby on rails site and it was the best description for a non techie like me that I could find in fast.

    --
    OMG Ponies!!! with Glitter!!!! I miss Pink :-(
  13. Re:Upgrading by masklinn · · Score: 2, Informative

    If you want Ruby on Rails 1.1:

    1. Check that you have the latest Ruby version (1.8.4) by running "ruby -v". If you do, go to step 2, if you don't upgrade your Ruby.
    2. Check that you do have the Ruby Gems software. Just type "gem -v" in the CLI. If you don't have RubyGems then go get it
    3. Once Gem is installed, just type "gem install rails --include-dependencies", this will install the latest version of Ruby on Rails and every package that's required by Rails (Rake, ActiveSupport, ActiveRecord, ActionPack, ActionMailer and ActionWebService). If you've ever used a Debian, think of "gem" as a Ruby-oriented version of apt-get.
    4. You're done, start Railing away.
    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  14. No problem / Noscript by fforw · · Score: 4, Informative

    The noscript firefox extension lets you forbid execution of javascript/java/flash by default and only enable it again for some sites (whitelist). Internet Explorer has "Trusted Sites" or something.. So all in all that is not that much of a problem..

    --
    while (!asleep()) sheep++
  15. Re:I haven't heard much by digidave · · Score: 4, Interesting

    I'm coding a large-scale site in RoR right now. It'll be deployed across three Lighttpd servers with two MySQL servers. I'm about three weeks into the site and I've probably saved a month of work already over how long it'd take me to do the same work in Java or PHP.

    Rails' efficiency won't continue to be that high as I get more into the business logic and smaller details, but for the data layers that I'm doing now Rails blows away anything else. I'll still be at least 50% ahead of where I'd be using Java and PHP when it's finished. The code will be way cleaner because Ruby is a better designed language than either Java or PHP. It'll be a snap to add features later, which is the problem we're currently having with our site and its 20,000+ lines of PHP code.

    I've coded and managed Java and PHP sites. PHP is easier to work with than Java for most small to medium sites and Java can be easier on large sites. Neither of them are better than Rails for any size site.

    I predict that Ruby on Rails will become the big third competitor in the market for building web apps. Java will still be bigger on the very high end because of EJBs and the need to interface with legacy systems and PHP will still be bigger on the low end because it's easier to learn since you don't need to know OOP to get started. Ruby on Rails will be the language/framework that finally fits into that middle market where most medium to large businesses are. PHP's code is too messy to work there without a lot of coder discipline and either a custom or well-done Open Source framework and Java is just too complicated.

    --
    The global economy is a great thing until you feel it locally.
  16. Re:Getting started by XaXXon · · Score: 4, Interesting

    Everyone raves about the poignant guide, but I found that after reading it for 20 minutes, I hadn't done much except read stories and comic strips. I really didn't have much of an appreciation for the language.

    There's something to be said for making a potentially dry subject interesting, but it seems to go too far with it and actually spread the actual information too thin.

    Just my opinion, of course.

  17. Re:Kudos to RoR... by ievans · · Score: 3, Insightful

    If you're using J2EE/Java EE for simple data-driven web sites a la RoR, then you're probably not the target developer for the Java EE platform. I have nothing against these web frameworks and the people who love them, I should add. It's just that the average /.er doesn't see the need for the features that are at the core of enterprise Java, and therefore they dismiss the platform as being too heavyweight. Sure, for small-scale development. The same mentality pops up in discussions on whether, e.g. MySQL needs transactions. It's kind of like hearing somebody who once built a dog house talk about the design requirements of a skyscraper.

    With that being said, Java EE 5 will make enterprise Java developer's lives much easier. EJBs, everyone's favorite whipping boy, are a lot easier to code now.

  18. Re:Ruby Apps by gregarican · · Score: 5, Informative

    There are tools for making Ruby into self-extracting executables --> http://www.erikveen.dds.nl/rubyscript2exe/index.ht ml. But for a true compiled solution that will likely be bundled with Ruby 2.0. It should include a VM --> http://www.atdot.net/yarv/. As for GUI apps there are extension libraries for Tk, Qt, Fox, WxWindows, GTK, etc.

  19. Re:I haven't heard much by BigZaphod · · Score: 2, Interesting

    Interesting comment. I'm curious about how Rails manages to save so much time as compared to PHP and the like. I don't have Rails experience and I've only just messed with Ruby enough to do a few Hello, World type things. What is it about the Rails approach that saves all the time and effort? I frequently see those claims, but it's a little harder to get solid, real-world examples.

  20. Re:Kudos to RoR... by helix_r · · Score: 4, Insightful


    The fact of the matter is that the vast majority of web-apps are actually in-house apps that have a fairly small number of concurrent users.

    Sadly, thousands of dev groups all over the world are slaving away very hard at j2ee simply because, well, its a good thing to have on one's resume or because consultants can bill mega-hours by building a "scalable enterprise application".

    If people were honest about their motivations and real scalability requirements, it would be clear that j2ee fits a niche market and that more rapid, easier-to-use dev frameworks like RoR fill mainstream needs.

  21. Re:Kudos to RoR... by ievans · · Score: 2, Informative

    No offense, but the oft-repeated anecdote about hundreds of poor schlups being forced to code horrendously overweight J2EE-apps while consultants wheel-away wheelbarrows full of cash doesn't ring true to me. What organization has this kind of money and time, especially since the downturn and what with offshoring development and all? Where are these companies?

    I also question your use of the term "mainstream." One person's niche technology is the next person's mainstream one. There are different market segments for development frameworks and technologies. Ones that require the sort of transaction, security, and connectivity capabilities that exist in Java EE would find RoR severely lacking. As you found out, stand-alone web apps with low numbers of concurrent users don't need the security, transaction, and connectivity support in Java EE, so those developers don't use it.

  22. Zope - What RoR wants to be when it grows up. by Qbertino · · Score: 3, Informative

    You know a thing is superhyped when v1.1 is mentioned on slashdot.
    Mind you RoR is cool compared to j2EE. Then again, it's allmost as if C is cool when compared to J2EE. J2EE sucks big time for server side web - even the Java Gurus agree on that. End of discussion, no news here.
    But RoR isn't the end all of ssi frameworks. Django is at least as good (I'd say better and cleaner than RoR) and Zope has been around since the ninties and still is years ahead of the rest. People with an overview over the technologies generally agree on that. I had a story submission (rejected) on that the other week. Check out the linked webcast, it's a very interessting analysis of a set of technologies and solutions:

    |||||
    Nasa/JPL Web Framework Shootout

    In an educative and entertaining webcast, Sean Kelly, a Nasa/JPL software engineer, goes into the details of a project based comparsion between a set of web application frameworks and servers. Including the much hyped Ruby on Rails and Django. Various Java technologies, Ruby on Rails, Django, TurboGears and Zope are covered. Details and traits of each are mentioned. For people involved with web developement there are not to many suprises though, yet the presentation and Kellys commenting are fun to watch.
    In a nutshell: EJB, Hibernate and various other Java flavours fail spectacularly, Zope scores a clear victory with Django, RoR and TurboGears relatively close behind. Development speed, error-gotchas, the need for hand-tweaking and the requirement of handwritten SQL and available documentation go into the measuring. As does an overall tongue-in-check "fun-factor". The details are interessting though. TurboGears 'error-driven' developement gets a positive review, RoRs automated controller generation aswell and Zope gets a complete rundown on it's astounding set of features. In the end long-time Java developer Kelly convinces us that - no matter what we do - we really, positively, don't want to use EJB or Hibernate for this kind of stuff. Very entertaining and informative indeed.
    |||||

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:Zope - What RoR wants to be when it grows up. by Senzei · · Score: 2, Insightful

      Zope is awesome for the things that zope already does. Extending it involves crawling pretty far into the zope system though.

      --
      Slashdot: Where anecdotes and generalizations can be freely substituted for facts, logic, or intelligence
    2. Re:Zope - What RoR wants to be when it grows up. by ubernostrum · · Score: 4, Informative

      In an educative and entertaining webcast, Sean Kelly, a Nasa/JPL software engineer, goes into the details of a project based comparsion between a set of web application frameworks and servers. Including the much hyped Ruby on Rails and Django. Various Java technologies, Ruby on Rails, Django, TurboGears and Zope are covered.

      Except he got more than a few things wrong. To pick one example, he seems to be under the impression that Django doesn't support i18n/l10n when, in fact, we ship all the core Django applications with support for twenty-odd languages, and Django uses an extensible gettext-based system to make it easy to translate third-party apps and add new languages. We even include an i18n JavaScript library to make translation strings available to JS code. Our admin app even has a setting that chooses which language to render a page with based on the incoming Accept-Language header.

      Moral of the story: nice video, but the guy hasn't necessarily done his homework.

  23. Re:I haven't heard much by Sokie · · Score: 3, Insightful

    I think an important thing to note here is that Rails is an web application framework for the Ruby programming language whereas PHP is just a programming language (with a few framework-ish features like session management).

    You could see similar productivity benefits by using a good PHP framework. The difference is that Rails is a fantasic framework and most of PHP's frameworks are mediocre. Part of this has to do with some of the language features that Ruby offers enabling Rails to be simpler to use and yet more powerful at the same time.

    Personally, I love Rails and I really hope that one of the recent PHP5 frameworks gets up to the point where it is comparable. If it doesn't though, I won't feel too bad leaving PHP (mostly) behind me.

    --
    ------
    Where are the slash-groupies? I distinctly remember being promised slash-groupies!
  24. Re:I haven't heard much by digidave · · Score: 3, Interesting

    First, scaffolding helps getting started because the programmer can work on code rather than building forms that connect to the database. The trick there is to use the 'generate' script to create the scaffolding in real code rather than use the run-time scaffolding. The generated code is pretty clean and does the bare minimum required, which is a great platform for building on.

    Second, with ActiveRecord the code feels very close to the data. When working within Rails' naming conventions it's very simple to do stuff like track back and forth in a data record and figure out what belongs to it (foreign keys referring to your data) and what it belongs to (foreign keys in your data referring to other data). Honestly, it seems heavy, but it works so well you forget about that. There have been a few times where I needed some data and found it already in my model object because the database relationship was there. This stuff has been made even better in Rails 1.1 because it stretches the relationship even more (relationships through other tables).

    Everything also gets done with a lot less code both because Rails makes things easy and because Ruby is designed really well.

    --
    The global economy is a great thing until you feel it locally.
  25. Re:Getting started by CptPicard · · Score: 3, Informative

    Hear hear, this is so true. Although I have been writing small Ruby scripts for a few years now, when I first took a look at RoR, I often had to pause to understand what exactly was happening in those very terse lines of code. You really need to understand Ruby's syntax and a lot of the philosophy quite deeply before you can grasp what is going on in RoR code. Without that understanding, you will never advance further in RoR than copying the tutorials.

    This is an example of a more general syntax-vs-semantics tradeoff in programming languages. Sure it's impressive how little code you have to write, but the other side of this is that the required understanding per line of code density is higher.

    --
    I want to play Free Market with a drowning Libertarian.
  26. Ruby on Rails? by grimsweep · · Score: 4, Funny

    I'm still waiting for C# on Cinderblocks.

    1. Re:Ruby on Rails? by Game_Ender · · Score: 2, Insightful
  27. Re:I haven't heard much by larry+bagina · · Score: 2, Informative

    If you're doing strightforward CRUD database stuff, RoR automagically sets up everything for you. If that's good enough, then you've saved some time. Even if you need to tinker with it, it's often less work than other languages.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  28. Re:Kudos to RoR... by 21chrisp · · Score: 2, Interesting

    Just because companies shouldn't be wasting money doesn't mean they don't do it.

    Java is ubiquitous in the corporate market. It is the Jack-of-All-Trades. It's what CTOs look for on a resume because they think Mr. Java can do ANYTHING, and Mr. Ruby might be able to learn Java after a year or so, but would be limited in what he could do until then.

    I still can't fathom why people think Ruby lacks transaction, security, and connectivity. My experience with it is that it's highly reliable and connects to almost anything. I've never had security problems w/ it.. but it is still a bit obscure. I have ruby apps on a site drawing 30 million hits a month with no problems. I have it connecting Solaris, Linux, OSX, and Windows. If I want to add full transaction support I could connect it to Postgress, ORACLE, DB2 etc etc. Is that good enough? Where is the feature set not working? It seems to me like you haven't spent much time with Ruby.

  29. Re:I haven't heard much by MPHellwig · · Score: 2, Insightful

    Every language is elegant if you know enough about it to do your job and ,despite that knowledge, don't have the motivation to learn something else. Me, I started coding in python a year ago, being my first 'real' language, I've come to a point where I'm even productive, so for me python is elegant. But I don't rule out the possibility that other languages are more elegant. Perhaps the best way to find out is to (re)do a project or 2 in another language. But I will continue python for a while, I still find it fun to do work with it and I still have to learn tons about the language and programming in general.

  30. See it & Try it & You're a Star? by JoeRails · · Score: 4, Informative

    Who's using Rails? Check out the Rails wiki site for hundreds of example sites

    And if you want a free cPanel/SSH account to download the new Rails version in to see what the craziness is all about - check out www.HostingRails.com

    I think its safe to say that Ruby on Rails is the fastest growing Web 2.0-friendly framework - and for good reason. I mean c'mon - the average developer can pick up a few Rails tutorials and have a working demo app (w/ CRUD scaffold action and such) on their local box in a few minutes. Throw in some easily-incorporated Prototype and Scriptaculous effects, and this developer is the new cool kid on the block.

    Crazy

    ~JoeRails

  31. Re:How about Catalyst? by it0 · · Score: 3, Interesting

    I'm a c/perl guy and don't know catalyst but wrote some sites in perl using html::template and I just read http://www.perl.com/pub/a/2005/06/02/catalyst.html ?page=2 for a short tutorial.
    I also just made my first rails website in 10 days, this includes a cms and also an elobarate scheduling app as well as some other stuff like user manager etc. This also includes the time to learn the language and get my head around concepts. The major problem with rails is documentation, there is just to much of it scattered around and should be organised more. But with the rails api website, the ruby docs and some tutorials you will get there.

    The last 2 days was just finetuning what the customer wanted. From the tutorial I would say rails is easier to read. I think perl has more power over ruby, just as C has more power over Perl as you can go more low level with it. But ruby/rails is much easier to read and even less to type.
    I will still remain to use C and Perl for a lot of stuff. But when it comes to websites / web applications I will stick with rails. I can't see myself turning back. Maintaining and extending code is dead easy also the ajax integration is great.