Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Ruby On Rails Goes 1.1

ScuttleMonkey posted more than 8 years ago | from the still-traveling-at-breakneck-speeds dept.


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 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."

cancel ×


Sorry! There are no comments related to the filter you selected.

GNAA FP (0, Troll)

programgeek (726420) | more than 8 years ago | (#15012365)

GNAA Announces OneNigger Suite of Collaborative Trolling Utilities
GNAA Announces OneNigger Suite of Collaborative Trolling Utilities

Misha Borovsky (GNAP) Hollywood, Ca - At a star studded event which was attended by both Jamie Foxx and Denzel Washington, two of Hollywood's leading gay stars, GNAA president timecop and vice-president jesuitx unveiled the latest offering from the GNAA Software Division, GNAA OneNigger.

"OneNigger is a hosted collaboration groupware for taking a more proactive approach to trolling. By leveraging OneNigger services with industry trolling best-pratices, the lone gay nigger, or small gay nigger organization is empowered to think outside the box." stated timecop.

Added jesuitx, "Furthermore, in our focus group testing we were able to increase LastMeasure coverage by 36.4% among bloggers participating in large blogrolls. Using modules like the OneNigger Date shared calendaring system allows groups to pick times to touch base on important trolling issues of the day."

Other modules in the OneNigger Enterprise version include OneNigger Chizzat running on patented extensions to IRC, OneNigger Phone, which offers VoIP technologies with free toll-free access to the USA and Japan, and Gay Porn Avalanche Enterprise 2.0 (GPAE2), now newly integrated into the OneNigger platform. OneNigger requires Microsoft Windows XP Service Pack 2 running on an Intel processor. AMD is not supported, as OneNigger is an enterprise-level software suite, and requires a powerful computer.

Later on at the after-party, GNAA member Depakote jacked off with this Microsoft OneCare CD, and consumed his seed, much to the squealing delight of Jaime Foxx.

About AMD:


About GNAA:
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the first organization which gathers GAY NIGGERS from all over America and abroad for one common goal - being GAY NIGGERS.

Are you GAY [] ?
Are you a NIGGER [] ?
Are you a GAY NIGGER [] ?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!
Join GNAA (GAY NIGGER ASSOCIATION OF AMERICA) today, and enjoy all the benefits of being a full-time GNAA member.
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the fastest-growing GAY NIGGER community with THOUSANDS of members all over United States of America and the World! You, too, can be a part of GNAA if you join today!

Why not? It's quick and easy - only 3 simple steps!
  • First, you have to obtain a copy of GAYNIGGERS FROM OUTER SPACE THE MOVIE [] and watch it. You can download the movie [] (~130mb) using BitTorrent.
  • Second, you need to succeed in posting a GNAA First Post [] on [] , a popular "news for trolls" website.
  • Third, you need to join the official GNAA irc channel #GNAA on, and apply for membership.
Talk to one of the ops or any of the other members in the channel to sign up today! Upon submitting your application, you will be required to submit links to your successful First Post, and you will be tested on your knowledge of GAYNIGGERS FROM OUTER SPACE.

If you are having trouble locating #GNAA, the official GAY NIGGER ASSOCIATION OF AMERICA irc channel, you might be on a wrong irc network. The correct network is NiggerNET, and you can connect to as our official server. Follow this link [irc] if you are using an irc client such as mIRC.

If you have mod points and would like to support GNAA, please moderate this post up.

| ______________________________________._a,____ | Press contact:
| _______a_._______a_______aj#0s_____aWY!400.___ | Gary Niger
| __ad#7!!*P____a.d#0a____#!-_#0i___.#!__W#0#___ | [mailto]
| _j#'_.00#,___4#dP_"#,__j#,__0#Wi___*00P!_"#L,_ | GNAA Corporate Headquarters
| _"#ga#9!01___"#01__40,_"4Lj#!_4#g_________"01_ | 143 Rolloffle Avenue
| ________"#,___*@`__-N#____`___-!^_____________ | Tarzana, California 91356
| _________#1__________?________________________ |
| _________j1___________________________________ | All other inquiries:
| ____a,___jk_GAY_NIGGER_ASSOCIATION_OF_AMERICA_ | Enid Al-Punjabi
| ____!4yaa#l___________________________________ | [mailto]
| ______-"!^____________________________________ | GNAA World Headquarters
` _______________________________________________' 160-0023 Japan Tokyo-to Shinjuku-ku Nishi-Shinjuku 3-20-2

Copyright (c) 2003-2006 Gay Nigger Association of America []

Congratulations Ruby on Rails (-1, Offtopic)

Anonymous Coward | more than 8 years ago | (#15012375)

Meanwhile Flock [] keeps [] hiring [] and hasn't managed to produce anything beyond a second-rate wannabe Firefox extension of absolutely no utility.

How many people are on the Ruby on Rails team again?

Re:Congratulations Ruby on Rails (1)

oldwarrior (463580) | more than 8 years ago | (#15012412)

We need not fear the future. Remember when folks ridiculed Java for being a silly, slow, toy that would never be ready for prime-time with no ide's and useless(cr)applets?

Times change. J2EE is more complex than MVS CICS used to be. Bloody shame. Rails or something like rails will make web development more problem-focused rather than tool-focused. At least for a while, until it becomes over-complicated by marketing-techs and propeller-head comittees.

Re:Congratulations Ruby on Rails (0)

Anonymous Coward | more than 8 years ago | (#15012533)

>Bloody shame. Rails or something like rails will make web development more problem-focused rather than tool-focused.

So, you're saying it will synergise my existing technologies thereby increasing my ROI while decreasing my time to market in a manner which is harmonious with the latest best-practices in the e-commerce marketplace?

Re:Congratulations Ruby on Rails (1, Funny)

Anonymous Coward | more than 8 years ago | (#15012556)

Remember when folks ridiculed Java for being a silly, slow, toy that would never be ready for prime-time with no ide's and useless(cr)applets?

It seems like only yesterday, wait, it was.

cool rjs (0)

Anonymous Coward | more than 8 years ago | (#15012394)

RJS is a nice addition to the framework, the Rails team is really doing a good job!

Getting started (0)

Douglas Simmons (628988) | more than 8 years ago | (#15012406)

I'd like to learn Ruby. Where's a good place to start for a beginner familiar with some php -- online tutorials or a particular book? How about a website that shows off what the language can do? Thanks!

Re:Getting started (4, Informative)

Noer (85363) | more than 8 years ago | (#15012421)

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.

Re:Getting started (2, Informative)

Anonymous Coward | more than 8 years ago | (#15012446)

Programming Ruby - a free ruby eBook - []

Re:Getting started (5, Informative)

BioCS.Nerd (847372) | more than 8 years ago | (#15012453)

This is a good place to start: [] and then perhaps this: [] (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: []

I hope this helps.

Re:Getting started (4, Interesting)

XaXXon (202882) | more than 8 years ago | (#15012754)

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.

Re:Getting started (1)

BioCS.Nerd (847372) | more than 8 years ago | (#15012835)

I tend to agree with you. I found some of it interesting, but in the end I keep going back to my copy of the "pick axe" book. As one of my friends put it, the poignant guide tends to be a little *too* poignant.

Re:Getting started (1)

moochfish (822730) | more than 8 years ago | (#15012465)

Not trying to insult or anything, but did you RTA? I believe the TFA points to the ruby on rails website which has plenty of resources. One of the links across the top labeled "screencasts [] " even has videos you can watch.

Re:Getting started (2, Informative)

gavri (663286) | more than 8 years ago | (#15012468)

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.

Re:Getting started (2, Informative)

gavri (663286) | more than 8 years ago | (#15012504)

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.

Re:Getting started (1, Redundant)

binner1 (516856) | more than 8 years ago | (#15012542)

I recently finished the Pick Axe book 2nd ed and would highly recommend it. Like one of the other replies notes, it's a Ruby book, not a Rails book, but I agree you should learn Ruby first. The first edition of this book is available for free on the web at various locations (eg: [] ). I started using this several years ago but got sidetracked. The recent Rails fuss has grabbed my attention again, so I finally sat down and dug in. It's now my language of choice for most programming tasks (quickly replacing Perl altogether for my needs). I've yet to do any Rails work, but have a few personal projects in mind that might be good testing for it. Ruby definitely stands on it's own as a language, Rails is just a beautiful use of a beautiful language.


Re:Getting started (1)

mslinux (570958) | more than 8 years ago | (#15012629)

I would suggest 'Programming Ruby'. The first edition can be read online here: []

Ruby is a wonderful language that is very flexible. I came to it from Python. I enjoy using both languages, but Ruby has replaced Python as my 'home' language. I don't do web devel.... there's much more to Ruby than Rails :) Ruby is an excellent Windows or Unix sys admin language or a great general purpose programming language or a scientfic/computational language as well. Rails simply demonstrates Ruby's power and flexibility.
Ruby will be around for a long time.

Re:Getting started (1)

Dasch (832632) | more than 8 years ago | (#15012876)

There has already been several replies pointing to very good resources, so I won't repeat those here. I myself came to Ruby from PHP - I had never used anything else (unless JavaScript counts), and I immediately fell in love. I've never gone back, and I don't think you will, either.

The main difference is that Ruby is a real *language*, not just a collection of Perl scripts (though PHP is maturing now; don't want to start a flame war.) You can alter it in almost any way you like, that's what so great about dynamic languages.

There are things you'll probably find confusing at first (I presume you know basic Object Oriented Programming from PHP 5,) particularly metaprogramming. Once you understand that, you'll be able to do things extremely simple and elegant.

I haven't heard much (-1, Flamebait)

Eightyford (893696) | more than 8 years ago | (#15012409)

I haven't heard much about Ruby since the (geek) media blitz of over a year ago. How many people actually use Ruby on Rails? I see the same thing happening with AJAX.

Re:I haven't heard much (1)

davecrusoe (861547) | more than 8 years ago | (#15012469)

To me, an intermediate PHP coder, it seems like a great way to move forward with developing new apps. Lots of redundancy in my PHP, and so I'm seeking a simpler, more elegant solution. Of course, that's partly due to my non-expert programming skills, but I'm switching over nonetheless. So, I guess you could say that it's gaining a following. The question is, as you point out rightly, how many sites have used it in their framework?

Perhaps there's no good answer, as commercial hosts are only now finally intergrating the Ruby code into their servers. But that they've elected (for example, Site5, my own host) to include the Rails in their hosting options seems to indicate that it's growing...

Re:I haven't heard much (1)

tcopeland (32225) | more than 8 years ago | (#15012490)

We're using it for indi [] with a PostgreSQL back end. It's working pretty well so far, even with a Jabber server hitting the same database [] .

Re:I haven't heard much (1)

finnif (945981) | more than 8 years ago | (#15012745)

You need to work on some performance enhancements. That front page of indi loads unbelievably slow. Rails is really easy. I'm worried about the first time my sites get /.ed though. Ruby needs that JIT interpreter bad.

Re:I haven't heard much (1)

tcopeland (32225) | more than 8 years ago | (#15012838)

> That front page of indi loads unbelievably slow.

Yup, that's just a function of the Rails 1.1 effect - [] is currently sharing a DSL line with, which is serving the RubyGem index that lets people install Rails with gem install rails. Yikes!

Re:I haven't heard much (1)

MadMirko (231667) | more than 8 years ago | (#15012551)

Penny Arcade is using it since a few weeks. I don't know if the glitches with the site lately have anything to do with that, but Tycho sometimes mentioned them himself. So, a new release should be welcome to them.

Re:I haven't heard much (1)

tyler.willard (944724) | more than 8 years ago | (#15012584)

Ruby started to gain popularity about 5 years ago when the following article was published:

Programming in Ruby

Dr. Dobb's Journal January 2001
A freely available pure object-oriented language
By Dave Thomas and Andy Hunt

(you can't read the whole thing without an account so no link)

Granted, it's been around for over a decade, but it took a while before it got attention outside Japan.

Re:I haven't heard much (2, Funny)

Anonymous Coward | more than 8 years ago | (#15012590)

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.

Re:I haven't heard much (1)

ilikeitraw (706793) | more than 8 years ago | (#15012749)

Actually, the RoR people now have spare time to hype it up.
Before RoR, they would be extremely busy finding bugs in their other web applications.

Re:I haven't heard much (1)

Gentlewhisper (759800) | more than 8 years ago | (#15013116)

>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.

They can afford to do so, afterall writing a web app with those dinosaur languages take 5-10X as long when compared to Rails...

Re:I haven't heard much (1, Funny)

hackstraw (262471) | more than 8 years ago | (#15012669)

I haven't heard much about Ruby since the (geek) media blitz of over a year ago. How many people actually use Ruby on Rails? I see the same thing happening with AJAX.

Its the way geeks do things.

It reminds me back in the late 90s when everything was Java!!!

It reminds me of even further back in high school.

Back then, everybody was interested in sex, talked about sex, wanted sex, but nobody was doing sex.

Same thing with Java in the late 90s and Ruby today, and AJAX tomorrow.

Re:I haven't heard much (4, Interesting)

digidave (259925) | more than 8 years ago | (#15012741)

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.

Re:I haven't heard much (2, Interesting)

BigZaphod (12942) | more than 8 years ago | (#15012827)

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.

Re:I haven't heard much (1)

yerfatma (666741) | more than 8 years ago | (#15012993)

As someone who works in C#, PHP and ASP at work and has barely played with Rails, it's the strict enforcement of MVC [] that is such a time saver. It's not enforcement like "You have to do things our way" to slow you down, but "We're going to make it easy to do things right so you don't cheat as often". It pays off in things like consistency and ease of refactoring.

He said, without having built anything of note in the Ruby or Rails.

Re:I haven't heard much (1)

pixr99 (560799) | more than 8 years ago | (#15013032)

You owe it to yourself to go check out some of the screencasts [] . The two features that have saved me the most time (so far) are:

  1. There's just about no configuration to do if you follow some simple and logical naming conventions.
  2. Once you've created your database table, a simple "ruby scripts/generate scaffold Model Controller" (substituting your actual model and controller) writes enough code so that you can do inserts, updates and deletes on the table.

From there, you start customizing.

Lets use Google as an example .... (1)

Shohat (959481) | more than 8 years ago | (#15012758)

As I see it , even if GoogleOS will not become the desktop standart , Google is heading in the direction of enabling many of the functions currently availble only as installed applications , through a web browser . Writely and Gmail are both AJAX based , and these are a word processor and a IM/Email application , both clearly target desktop-application dominated markets. To understand it better , you might want to use Gmail through a simple Javascript disabled interface (it is also supported, through basic HTML view) and see how it behaves . I believe that everything that is not content, will be delivered using an AJAX based interface in the near future .

Let me... (1)

irimi_00 (962766) | more than 8 years ago | (#15012416)

Let me be the first (or not) to say congrats to the dev team. I am sure this will make it easier to connect people, make money, and functionality online.

Ruby Tutorials (5, Informative)

emo boy (586277) | more than 8 years ago | (#15012418)

Re:Ruby Tutorials (1)

Radres (776901) | more than 8 years ago | (#15012916)

So if you're currently a Java rich client programmer, with no J2EE experience, how can you get a job as a Ruby coder (other than inventing a site to implement for yourself)?

CakePHP (-1, Offtopic)

moochfish (822730) | more than 8 years ago | (#15012424)

Speaking of rails and cake... [] just released 0.10.9 about a week ago.

What a crock (-1, Troll)

Anonymous Coward | more than 8 years ago | (#15012434)

AJAX is the SOAP of the 00's, and this whole "..on RAILS" bullshit is long on hype, and short on technical merits.

Can we PLEASE stop hearing about PHB-pleasing marketroid crap and instead focus on technologies which are actually proven, solid and reliable (eg; perl, apache, et al)?

Re:What a crock (0)

Anonymous Coward | more than 8 years ago | (#15012923)

1997 called they want their shitty cgi script you wrote them because you are too ignorant to learn new technologies. AJAX requests are issued via soap/xml.

Ajax a welcome addition (1)

FecesFlingingRhesus (806117) | more than 8 years ago | (#15012435)

It is nice to see them add the AJAX / JavaScript integration. I would like to see more frameworks include a mature AJAX framework to facilitate more dynamic interaction. To date the best I have seen so far is Echo2 [] which incorporate an event driven architecture that allows for seamless integration of client side events transmitted to the server side architecture. In all good show, I hope more frameworks will follow suit.

Re:Ajax a welcome addition (0)

Anonymous Coward | more than 8 years ago | (#15012492)

Do you work in marketing by any chance?

Re:Ajax a welcome addition (1)

FecesFlingingRhesus (806117) | more than 8 years ago | (#15012501)

No I design web-based enterprise systems, I make it my job to evaluate all possible framework options.

Weaknesses of "prototype.js" (1)

SimHacker (180785) | more than 8 years ago | (#15013061)

As someone who's evaluated various JavaScript frameworks, what do you think of "prototype.js", the AJAX library that Ruby uses?

Does the new version of Ruby continue to use "prototype.js" or has it switched to a better designed and documented JavaScript framework?

How is the documentation of "prototype.js"? Does it have a rigorous test suite? How does "prototype.js"'s documentation and test suite compare with, say, MochiKit [] ?

Does "prototype.js" continue to define additional methods on Object.prototype? How does it deal with the issue that defining extra methods on Object.prototype causes "for (key in obj)" to return those method names for every object, totally breaking a fundamental JavaScript language construct, and making it extremely difficult to integrate other JavaScript libraries and code modules without suffering mysterious bugs and crashes?

A JavaScript framework should NEVER define methods on Object.prototype or Array.prototype, because doing that breaks all JavaScript code that iterates over the keys of objecs or arrays, which is certainly not very friendly nor modular. Why did Ruby choose to use an AJAX framework that makes such a huge mistake? Have the maintainers of "prototype.js" gotten around to cleaning up that mess, and why did they make such a horrible mistake in the first place? Weren't they aware of this horrible JavaScript quirk, and why didn't they work around it in the first place? Isn't that supposed to be why we use JavaScript frameworks: to avoid such problems?


Why I Don't Use The prototype.js JavaScript Lib. (0, Offtopic)

SimHacker (180785) | more than 8 years ago | (#15013163)

Here's an article from James Mc Parlane's Blog [] that describes the horrible problem with prototype.js and its ilk that define methods in Object.prototype and Array.prototype.


James Mc Parlane's Blog []

Why I Don't Use The prototype.js JavaScript Library []

When it comes to JavaScript there is one issue for which there seems to be two polarised camps, and that is the question of extending the inbuilt JavaScript Array and Object types via the prototype object. There are those who do, and those who don't.

I am most definitely one of those in the "Don't, because it 'would be bad'" camp.

Now, thanks to the Web2.0/Ruby On Rails/Nuevo Bubble phenomena there is a widely used library that makes great use of the prototype object and that is Sam Stephenson's prototype.js library.

I ran into an issue 6 months ago and decided I would never ever use prototype.js, despite the fact, and I don't say this often, that after an examination of the code, prototype.js is an inspired work of art.

What I and many [] many [] others [] have discovered [] is that using the prototype object on the Array and Object inbuilt types increases the chances that your code will conflict with existing or external code. It makes your code not play well with others, so once you start using prototype.js, you have to keep using prototype's paradigm because by extending Array and Object via the prototype object it secretly modifies some of JavaScripts default behavior.

It's the crack cocaine of JavaScript.

This can be a good thing. If you don't want to waste time writing your own JavaScript libraries and learning how everything really works, then using prototype.js and the libraries that extend it (e.g. Open Rico) is a very good way of developing. You will save time and money and all you need to learn is "the way of prototype.js".

Now the entire tasty raisin for the MetaWrap JavaScript libraries is to allow others to easily remix MetaWrap applications via a client side API that can be invoked via XML. The result is that CSS, HTML and JavaScript can be injected into the application, or XML and HTML at any point in the rendering pipeline of the application.

So I simply had to reject prototype.js because, out of the box, the very first time I tried to use it - it snuck out and cut the throat of the JavaScript I was using that relied on performing a for(x in object) on the contents of an Array.

In JavaScript, value types are subdivided into primitives and objects. Objects are entities that have an identity (they are only equal to themselves) and that map primitive properties to other value types, ("slots" in prototype-based programming terminology) - see these testcase #5 - #7. Because of this behavior JavaScript objects are often mistakenly described as associative arrays or hash tables, while functionally they behave like an associative array/hash table, technically this is not their true nature.

Despite this the JavaScript programming world has come to rely on these objects behaving as predictable associative array/hash tables - and prototype.js breaks this.

There is no object more galactically useful than a good associative array/hashtable. There is no problem that can't be solved with a large enough hash table. In highly granular interpreted languages like JavaScript it provides a way to dip into pure native brute force computing power mostly unhindered by the language interpreter.

It is because this has been tampered with that I have to turn my back on prototype.js and say Nyet!

Now lets look the issue in some detail and in particular at the way that JavaScript uses arrays and the way that we create and access data in those arrays.

Although in reality there is one method to access data in an array array[value] = object;, there are two defacto methods. The first is numerical indexing, whereby you access each element in the array by a single number - this is supported by the inline constructor, shorthand and the array.push functions that add items to an array automatically via a numerical index.

The following three approaches will create an identical numerically indexable array.


"Specified numerical index"

var array = new Array(); array[0] = "Apple"; array[1] = "Orange"; array[2] = "Banana";


var array = new Array(); array.push("Apple"); array.push("Orange"); array.push("Banana");

"Inline Constructor"

var array =new Array("Apple","Orange","Banana");

"Inline Constructor Shorthand"

var array = ["Apple","Orange","Banana"];

The elements of this numerically indexable array can be accessed via the following methods...

By directly indexing into the array with a number using for(;;)

var i; for(i = 0;i > array.length;i++) { alert(array[i];) }

or via the for(in) iterator

for(var i in array) { alert(array[i]); }

But I mentioned there were two methods to store and access data in arrays..

The second is as an 'associative array/hash table', where in the index is not an number, but one of the other primitive value types (String or Float for example).

var array = new Array(); array["A"] = "Apple"; array["O"] = "Orange"; array["B"] = "Banana";

In this case array.length will be 0. There are three items in the array - but is length property will return 0.

This array is only useful if you know what the primitive value index is for a particular object. Array look-up performed natively within the interpreter so is very fast, which makes for a perfect hash table structure, but if you want to iterate all items in the array, you have to use the for(in) iterator method.

Sadly - protoype.js breaks this by adding 'extend' object that appears in every array.

So you have to be very careful about how you introduce external JavaScript that is not based on prototype.js. Prototype uses the JavaScript prototype level expando trick (via the prototype. keyword) to add extra objects to the inbuilt function and Array, Object and Function types.

After you include prototype, every array gets an extra element.

See these testcases.

When you execute testcase #1 this it will result in "extend A B C " instead of "A B C" - so it fails.

Now this can be remedied by the next testcase #2 that does not use for(in) but instead uses a numeric index into the array via an old style incremented for(i = 0; i < array.length; i++).

For associative arrays, there is no hope. Prototype makes associative arrays unreliable when it comes to using the for(x in array) loop.

The only way I can protect my code is to not use for(in) for an array that is not associative, and for associative arrays, treat 'extend' as a sentinel that gets skipped.

// Guard against prototype if (l_node == "extend") continue;

The problem I am describing here is the result of one of the extensions made by prototype.js (version 1.3.1)


There are 5 others..


On browsers that don't already implement push (IE5) then this will appear in an enumerated version of the array via for(x in object).






Upgrading (0)

Anonymous Coward | more than 8 years ago | (#15012444)

upgrading this time promises to be a piece of cake


By coincidence, just last week I decided to install Ruby On Rails. I looked at the download page and found you had to download like six different things just to make it work, and some of them had warnings they might not work right on Mac OS X.

So I just downloaded something off versiontracker called "Locomotive". I haven't installed it yet.

If I want Ruby On Rails 1.1:
  1. Is it possible to just install locomotive and then upgrade from 1.0 to 1.1? What is the procedure, do I just run this "gems" thingy?
  2. Is there a better way to install 1.1?

Re:Upgrading (1)

gregarican (694358) | more than 8 years ago | (#15012508)

For now Windows-based implementations are a "piece of cake [] ." But in time Mac OS X will be as well. This RoR project is still relatively young so I think the hype is moving forward faster than the underlying technology. Nevertheless a good thing to investigate...

Re:Upgrading (1)

ceejayoz (567949) | more than 8 years ago | (#15012627)

OSX already has Locomotive [] for that.

Re:Upgrading (3, Informative)

metamatic (202216) | more than 8 years ago | (#15012572)

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. []

Re:Upgrading (2, Informative)

masklinn (823351) | more than 8 years ago | (#15012673)

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.

Re:Upgrading (0)

Anonymous Coward | more than 8 years ago | (#15012959)


Re:Upgrading (0)

Anonymous Coward | more than 8 years ago | (#15012978)

Is there a way to upgrade ruby 1.8.2 to 1.8.4 as easily as it is to upgrade rails. Tried googling a bit, and couldn't find anything simple. I'm using windows.

Javascript is insecure - AJAX is security hole (3, Informative)

billstewart (78916) | more than 8 years ago | (#15012502)

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.

Re:Javascript is insecure - AJAX is security hole (5, Informative)

gregarican (694358) | more than 8 years ago | (#15012526)

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

Re:Javascript is insecure - AJAX is security hole (0, Flamebait)

Llywelyn (531070) | more than 8 years ago | (#15012892)

That would require me to use Internet Explorer, which is just replacing one security hole with another.

Re:Javascript is insecure - AJAX is security hole (1)

gregarican (694358) | more than 8 years ago | (#15012933)

We're not talking about you (i.e. the context of a web applications developer). We are talking about the general public using a website containing AJAX-delivered applications. And, hate it as you might, the majority of website visitors are still using Internet Explorer. And proposing a patch for the Javascript hole in IE is the point of my post...

Re:Javascript is insecure - AJAX is security hole (1)

Dan Ost (415913) | more than 8 years ago | (#15012528)

If you're already running Firefox, the NoScript extension is a simple way to protect yourself from what you just described. I would also expect other browsers allow you to white-list specific sites (though maybe not as easily as NoScript).

Re:Javascript is insecure - AJAX is security hole (1)

syphax (189065) | more than 8 years ago | (#15012763)

Mod parent up; for a small inconvenience (you have to add each site to your whitelist with 2 clicks), NoScript provides a lot of protection. It also shows you how much fricking code is pulled from other domains- scary. The page on which I type this pulls code from:
and good ol'

NoScript lets you select which code to run, and which to ignore. Inconvenient but awesome.

And somewhat on-topic, check out

Re:Javascript is insecure - AJAX is security hole (1)

TrancePhreak (576593) | more than 8 years ago | (#15012536)

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.
IE already impliments settings that allow you to whitelist sites for scripting. So by your meaning, Mozilla is toast.

Re:Javascript is insecure - AJAX is security hole (4, Funny)

ceejayoz (567949) | more than 8 years ago | (#15012609)

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

Re:Javascript is insecure - AJAX is security hole (0)

Anonymous Coward | more than 8 years ago | (#15012633)

Who says that all web apps have to be on a public network? Rails works well for in house applications and admin apps.

No problem / Noscript (4, Informative)

fforw (116415) | more than 8 years ago | (#15012690)

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..

Re:Javascript is insecure - AJAX is security hole (1)

Bogtha (906264) | more than 8 years ago | (#15012774)

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

If that's true, then the Ajax/JavaScript support in Rails is severely broken. Properly written JavaScript degrades gracefully, so that the people who have JavaScript enabled get the benefits of it, but the people who have JavaScript disabled can still use the application.

Can anybody who's used this new part of Rails comment on this? Does it really generate JavaScript that doesn't degrade gracefully? If it's true, then my opinion of Rails just plummetted.

Re:Javascript is insecure - AJAX is security hole (0)

Anonymous Coward | more than 8 years ago | (#15012945)

Well, you don't HAVE to use javascript to use Rails.
Last I checked Rails simply cuts down your web dev time by doing a lot of the inane, repetitive tasks for you, and facilitates getting down with databases.

I could be wrong, not like I've coded in it either.

Re:Javascript is insecure - AJAX is security hole (1)

Krimszon (815968) | more than 8 years ago | (#15012914)

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 How many people have turned js off?

Re:Javascript is insecure - AJAX is security hole (1)

zardo (829127) | more than 8 years ago | (#15012941)

Do you wear a football helmet when you drive? Just curious.

Re:Javascript is insecure - AJAX is security hole (1)

metamatic (202216) | more than 8 years ago | (#15012943)

The easy way around the problem is per-site JavaScript permissions. Internet Explorer has allowed you to set up your browser like that for ages, I'm surprised Firefox isn't the same way.

Still, there's a plugin for it [] ...

Rails is Great (5, Interesting)

nashjobs (964268) | more than 8 years ago | (#15012505)

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?

Re:Rails is Great (2, Insightful)

Anonymous Coward | more than 8 years ago | (#15012554)

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 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.

Re:Rails is Great (2, Funny)

StarvingSE (875139) | more than 8 years ago | (#15012734)

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

Re:Rails is Great (1)

destiney (149922) | more than 8 years ago | (#15012736)

You might add an entry to routes.rb and get rid of those fugly category URLs.

Just a thought..

Re:Rails is Great (-1)

Anonymous Coward | more than 8 years ago | (#15012889)

Oh wow that's just amazing... Oh wait, no it isn't. I can do that shit with the current framework (inhouse, administration backend to boot) I use, in under a week. And no, any arguments about not using frameworks won't stand, because if you start working from zero with every new project, you clearly are an idiot and deserve whatever is coming to you.

Re:Rails is Great (2, Interesting)

catch23 (97972) | more than 8 years ago | (#15013122)

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.

Looking to get started in Rails? (4, Insightful) (960072) | more than 8 years ago | (#15012506)

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 [] -- Exercise for Web 2.0.

Re:Looking to get started in Rails? (1)

bahwi (43111) | more than 8 years ago | (#15012870)

Agreed, no online tutorial did it for me, just made me look away. Then I read "Getting Real" from 37signals (look it up, a pdf book, cheap and worth it but I'm not their advertising co and it's easy enough to look up). That made me get Agile Dev w/ Rails after 3 bookstores to find it(It's not catalogued with Ruby books since it doesn't say Ruby in the title, so be careful!) and sat down and went through the first bunch of chapters pretty quick.

The thing I like especially is the unit testing, still getting my brain around it though.

Re:Looking to get started in Rails? (1)

catch23 (97972) | more than 8 years ago | (#15013071)

Ruby is a pretty nice tool, I do think it has far too much hype however. The hype is almost as bad as AJAX.

Re:Looking to get started in Rails? (1)

catch23 (97972) | more than 8 years ago | (#15013149)

One of the things I really liked about Ruby was the RubyGems project. It's sorta similar to Maven in the Java world in that it will go out and fetch additional package dependencies for software. I think Java really needs some kind of semi-centralized repository of open source packages so that one does not have to go through the trouble of reconfiguring packages all the time. My current project at work uses over 30 lgpl licensed projects and it's one big pain in the butt to upgrade these packages all the time. We software people need apt-get!

Web an API junkyard (3, Interesting)

amightywind (691887) | more than 8 years ago | (#15012522)

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!

Re:Web an API junkyard (1)

killjoe (766577) | more than 8 years ago | (#15012985)

I couldn't agree more. You know what the saddest part is? The applet could have saved us years ago. Only if Sun wasn't so incompetent and MS wans't full of such evil bastards.

Re:Web an API junkyard (1)

amightywind (691887) | more than 8 years ago | (#15013027)

I agree. I am a little surprised the applet hasn't come back into style. It certainly provides a rich interface and is nowhere near as contorted as some of these 'frameworks'. It would have been nice if several languages could have supported Java bytecode output. Kawa scheme does. I don't know of any others. Another thing I have been puzzled about is why Sun never freed the Hotjava browser. In the old days, I used to like it. It certainly ran applets cleanly.

Kudos to RoR... (1, Funny)

helix_r (134185) | more than 8 years ago | (#15012580)

... May this be yet another nail in the coffin of the life-sucking tedium that is J2EE.

Re:Kudos to RoR... (1)

what about (730877) | more than 8 years ago | (#15012693)

Since you mention J2EE and by consequence Java, I suggest you have a look at this comparison chart []

You draw your conclusions

Re:Kudos to RoR... (1)

helix_r (134185) | more than 8 years ago | (#15012782)

My conclusion is that the compute-intensive performance of java versus ruby does not really make much difference for the vast majority web apps.

It is not about performance. It is about developer productivity.

Re:Kudos to RoR... (1)

CastrTroy (595695) | more than 8 years ago | (#15012858)

Exactly. Most web applications aren't really that computationally expensive. Most of the slowdowns are from database access, and network speed/content-size. Once those issues are fixed, then we can worry about languages that are faster than others.

Re:Kudos to RoR... (1)

digidave (259925) | more than 8 years ago | (#15012878)

Java is faster, but Ruby is easier on system resources. Ruby on Rails scales far easier than Java and saves mountains of developer time both while initially programming the app and maintaining it later.

My conclusion is that Rails apps are easier to program, easier to scale to multiple servers, easier to deploy, and they run slower than Java apps in some circumstances.

Re:Kudos to RoR... (3, Insightful)

ievans (133543) | more than 8 years ago | (#15012784)

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.

Re:Kudos to RoR... (1)

molarmass192 (608071) | more than 8 years ago | (#15012875)

I was just going to suggest that the parent has deved a website used by more than 2 people. You've put it much more eliquently, I especially like the build a dog house vs. build a skyscraper comparison. I'd add, that Java is far more widely known. I can walk away from my code and KNOW somebody will be able to pick up where I left off, customers tend to like that kind of thing.

Re:Kudos to RoR... (4, Insightful)

helix_r (134185) | more than 8 years ago | (#15012907)

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.

Re:Kudos to RoR... (2, Informative)

ievans (133543) | more than 8 years ago | (#15013020)

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.

Re:Kudos to RoR... (0)

Anonymous Coward | more than 8 years ago | (#15012801)

Ahh, the lament of the developer who hasn't yet discovered Spring [] ...

And unlike Rails, it scales beyond three concurrent users.

This seems good for layman understanding (5, Informative)

AgNO3 (878843) | more than 8 years ago | (#15012667) [] 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.

Ruby Apps (1)

Rac3r5 (804639) | more than 8 years ago | (#15012720)

I'm not a Ruby developer, the most I've done is just skimmed over some Ruby tutorials. I like the ease and simplicity of the Ruby syntax.

Is it possible to make stand-alone, executable apps in Ruby? What about GUI?

Re:Ruby Apps (1)

mslinux (570958) | more than 8 years ago | (#15012787)

Yeah, for sure... this [] was written in Ruby. It's a stand-alone win32 executable for hashing files, strings, etc...

Re:Ruby Apps (5, Informative)

gregarican (694358) | more than 8 years ago | (#15012796)

There are tools for making Ruby into self-extracting executables --> ml [] . But for a true compiled solution that will likely be bundled with Ruby 2.0. It should include a VM --> [] . As for GUI apps there are extension libraries for Tk, Qt, Fox, WxWindows, GTK, etc.

Re:Ruby Apps (1)

kbob88 (951258) | more than 8 years ago | (#15012960)

Sort of... not totally stand-alone in the traditional binary executable sense. You still need the Ruby interpreter.

But several tools (Ruby2EXE, ExeRb [] ) allow you to bundle your program, libraries, and the Ruby interpreter into an executable that you can then distribute. I've used them in the past and they work well -- never had any users tell me they couldn't install the program.

There are various options available for a GUI. I've used wxRuby [] a lot. It's an interface to the WxWindows/WxWidgets toolkit. I think it works very well, and I really like it's auto-layout features using sizers, although the API is very C++-like.

Another toolkit that people use a bunch is fxruby [] , which interfaces with the Fox toolkit.

There are lots more GUIs. Take a look at the Ruby App Archive [] or lurk on the mailing lists [] to see what toolkits people are using (or just ask them).

Zope - What RoR wants to be when it grows up. (3, Informative)

Qbertino (265505) | more than 8 years ago | (#15013119)

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.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>