Ruby on Rails 0.13 Out Today with AJAX Superpowers 79
Robert J. Berger writes "The Ruby on Rails team announced that "After the longest gap between releases since Rails was made public and after more than 225 fixes and new features, the final major release before the 1.0 milestone has arrived."
This is a major update to what is to many developers
consider the new tool for developing sophisticated interactive database driven web applications. It integrates
backend Model/View/Controller object-oriented model with
AJAX based clients so that the developer can focus on the app and not on the details of basic mechanisms. You really can do much more with much less coding.
The new release adds a completely rewritten visual effects engine, drag-and-drop capability including sortable lists, and autocompleting text fields to Rails. All building on top of an upgraded version of Prototype, the javascript foundation for Ajax in Rails ... Check out the very cool
demos at script.aculo.us."
This is actually really damned good (Score:3, Interesting)
Imagine a web enabled version of Delicious Library [delicious-monster.com] with this. Fuck, that's cool.
Re:This is actually really damned good (Score:2)
Re:This is actually really damned good (Score:3, Informative)
I've been XMLHTTP-ing a bunch of old ASP code (and made a cool cross-browser chat page), and thinking about moving a bunch of stuff to PHP. Now I might chuck it all and see if I can use Ruby instead. Scary simple.
Re:This is actually really damned good (Score:2)
Re:This is actually really damned good (Score:2)
Sorry for the mix-up.
Re:This is actually really damned good (Score:3, Informative)
Re:This is actually really damned good (Score:1)
Re:ad (Score:1)
Nah. (Score:2)
Here's why... (Score:3, Insightful)
Re:Here's why... (Score:1, Offtopic)
Re:Here's why... (Score:1)
Re:Here's why... (Score:3, Insightful)
Ruby? Half-baked? Ruby hasn't been around as long as Python, but it's not exactly the flavor of the month. And have you seen the people backing Ruby? [pragmaticprogrammer.com] The authors of those books are not amateurs.
And since when is a language wich such an excellent spread of features a "masturbation language"? Closures, a powerful standard library, continuations, open classes, everything-is-an-object... I could go on. These aren't "bleeding edge" features. These are features
Re:Here's why... (Score:2)
Don't you think that with the exception of GUI design, OOP is a little OVERRATED?
Re:Here's why... (Score:2)
Not for data types. The fact that I can ask my integers what precision they are, or define new string routines, or conveniently redefine how my IO sockets is a good idea.
Besides, who says OO excludes functional paradigms? Not OCaml or Common Lisp, that's for sure.
Besides, Ruby isn't about pure object modeling. Because of all its very functional features (Did you know Ruby has no "statements", only expressions? Everyt
Re:Here's why... (Score:1)
This is fantastic stuff! (Score:5, Interesting)
Users can sort the pictures in their galleries by dragging them to the position they want and doubleclick them to hide them (it then becomes 50% transparent). The user always get immediate feedback without reloading the page thanks to Ajax. For translators the site is inline editable. Just doubleclick on a textfield or alt+click on a string to edit it inline. Click "save" and it's changed. Admin stuff is always available but hidden by default in drawers that you can slide in when you need them so you can be logged in as an admin an change any setting, delete posts etc without needing to go to a separate admin page or have a cluttered interface. You don't even have to reload the page in most cases...
All this stuff is damn easy to implement thanks to the wonders of Ruby on Rails and the Prototype framework.
Re:This is fantastic stuff! (Score:2)
I can't believe I didn't think of that before you just mentioned it...did you roll your own, or find a decent example? I did that once before for some old pages that had a lot of updates, but without the benefit of AJAX-type technology.
Care to share some code with the rest of us?
Re:This is fantastic stuff! (Score:4, Interesting)
Make sure textfields are inside a <div class="editable" id="text_id"> and wrap strings in <span class="editable" id="string_id"> where text_id/string_id is the id of the text/string in the database.
Create a Javascript behaviour that finds all nodes that has class "editable". Prototype comes with the function getElementsByClassName().
On each div, add a ondblclick event that:
* creates a textarea node and put it inside the div.
* hide the old content
* set value of the textarea to the text content
* add a submit button that has onclick = "new Ajax(foo);" where foo is the parameters for your ajax call and set it to update the current editable div (so the textarea will be overwritten)
* the action for the Ajax call should return the output of the saved text.
do the same for strings but use a input type="text" instead.
Re:This is fantastic stuff! (Score:2)
A better solution would be to start with a page that has an "edit" button that works without Javascript. Then have your Javascript check to make sure the AJAX stuff is available, and makes the visibility of the edit button hidden (while keeping a rule that unhides it on
Finding all the
solaris/firefox 1.04 (Score:4, Insightful)
Of all the samples, only the shoping cart works at all on Firefox1.04 on solaris. Everything else just does nothing and renders horribly. Even the shoping cart demo fails to render things properly, even when it works.
sigh...
I really really really want to like this... but how is relying on the client to run code properly sane, with all the different clients out there?
Re:solaris/firefox 1.04 (Score:1)
and the point isn't just solaris. Using heavyweight client side code like this is great for eyecandy-type features, but it's extreemly inconsistent in it's implementation.
have they validated that this works on Opera, Safari, other strange platforms, etc etc? I don't mean it has to support all of the cool new features - it should degrade nicely, not "click, do nothing besides render badly".
Re:solaris/firefox 1.04 (Score:2)
Re:solaris/firefox 1.04 (Score:1)
I still don't trust heavyweight client stuff, though.
At least with java-applets (shudder) it should work on any browser with a JVM.
Re:solaris/firefox 1.04 (Score:2)
As far as Firefox-on-Solaris goes... there's no reason it shouldn't work there, is there? I don't know Ruby-on-Rails specifically, but Firefox/Solaris shouldn't be any different from Firefox
Re:solaris/firefox 1.04 (Score:1)
maybe google is only using a "safe subset" of features?
Yah, firefox should be the same everywhere, I'd think, but it's not apparently.
When I drag item in the shoping cart, I don't get a picture of the drag, just the basic mouse pointer. When I try the auto-complete, nothing happens at all.
I'll have to try it on Firefox/Linux when I get home...
Re:solaris/firefox 1.04 (Score:1)
I'm pretty much with you here. gmail doesn't rely on the client handling anything properly. They have a straight html version (which I keep meaning to check out through lynx. There just aren't enough hours in the day. Anyone played with that?)
Anyway, this sort of thing's really exciting. In a lot of ways, I've never much liked writing GUI stuff. Develop
Re:solaris/firefox 1.04 (Score:4, Insightful)
I'm running Firefox 1.0 on Solaris, and they all worked fine, albeit a bit slowly. I'm not sure what you're seeing. Perhaps one of your extensions is borking something? If your filtering
Re:solaris/firefox 1.04 (Score:1)
I'm more and more confused about this the more I look at it. Perhaps it is something borked up with my solaris install? This would not exactly be a revalation.
that just lends evidence to my theory that using heavyweight client side code is too fragile. if it breaks that easily, why trust it?
Re:solaris/firefox 1.04 (Score:1)
And Mac OS X Safari/Firefox, Windows IE6 (although the transparency is glitchy, of course), and Linux Firefox & Mozilla.
future of the web? (Score:1)
why? RoR is a framework (unlike php, for example). postgres has more features then the more common mysql. JS improves usability.
Re:future of the web? (Score:1)
The corporate Internet will wonder whether instant feedback when people have been used to non-instant feedback for years on the net already will be worth having to develop and test 2x the funcationality (with + without javascript) to avoid being the test case in 508/DDA discrimination lawsuits.
Re:Crappy Autocompletion (Score:2)
The AJAX doesn't run in Opera... (Score:2)
Re:The AJAX doesn't run in Opera... (Score:2)
Re:The AJAX doesn't run in Opera... (Score:1)
Some people wonder why anyone would use Azureus.
Either way, one of the goals of bittorrent was to make downloading as natural as possible to the user. You click a .torrent link, bittorrent reads the .torrent metafile and connects to the tracker and peers to start downloading. But to the user, it looks almost like a regular download dialog.
Opera goes one step further by integrating a bittorrent into the browser, eliminating the need for a client, and simply bringing bittorrent one step closer to being a
Demos (Score:3, Insightful)
Great. AJAX shopping carts. Will no one learn from the usability problems people found using Flash for such things?
AJAX is great... for applications where the state is not particularly important (i.e., enough to be bookmarked). A product catalog and shopping cart is not one of this type.
Re:Demos (Score:2)
Re:Demos (Score:1)
Re:Demos (Score:2)
This shopping cart [panic.com], for example, works just fine without being able to bookmark individual product pages.
Sure, if I were Amazon.com with millions of products there'd be problems with a single page catalog, but most small e-businesses don't need a huge shopping cart.
Re:Demos (Score:2)
What are you talking about? You can use AJAX for a product catalogue and shopping cart easily without breaking things.
What matters is that important entry points should be addressable by URI. When somebody adds something to their shopping cart, it doesn't matter that immediately following the action, the resulting view isn't
Re:Demos (Score:1)
Show me an implementation of an AJAX product catalog that doesn't suffer from severe usability problems. Backbase is a perfect example of why this is not a good idea: http://projects.backbase.com/RUI/shop.html [backbase.com]
Re:Demos (Score:2)
Well AJAX is only recently gaining mindshare amongst developers, so there's not many examples of it out in the wild.
In any case, I can't think of a single product catalogue, with or without AJAX, that doesn't have usability problems.
No, that's a perfect example of a terrible use of AJAX. It's also a perfect example of a terr
Well... (Score:1)
Re:Well... (Score:1)
The quicker design/test/deploy cycle, if true, would be a GoodThing(tm) and I can clearly see it's benefits.
Drag and drop is often just not very practical at all. I could state numerous examples why it isn't useful for (internally used) webapps but I'm not writing an essay here. Furthermore, you have misunderstood me if you think I mean that eye-candy is for people who do not know what they're doing. If people kn
Re:Well... (Score:1)
FUD = Fear, Uncertainty, & Doubt (Score:1)
Will this drastically improve development time? Or is it just FuD like all the other 'promising' stuff we've seen?
FUD is spreading fear, uncertainty, and doubt about your competitors product.
Maybe RoR spreads FUD about J2EE, but a product itself cannot be FUD...
Impressive, but... (Score:1, Troll)
That said, this technology is full of problems by its nature. Browser support is no longer the issue it once was (especially if the framework takes care of the remaining differences for you), but many browsers do DHTML very slowly, and more often than not it just doesn't have the right feel to it (as in, it still look
Re:Impressive, but... (Score:1)
Re:Impressive, but... (Score:3, Insightful)
Sending data from the server to the client is completely impossible, unless you somehow keep your request from completing, wh
Re:Impressive, but... (Score:1)
Re:Impressive, but... (Score:1)
Whist it's not perfect and support does vary it solves the problem you mention. Javascript makes the request and handles the response so there is no need to do a full page refresh just to get one word back to stick in the middle of the page (or whatever).
You probably could write an IRC client using this technique (not saying you should, just could). It would need to poll the server every n seconds or something to check for updates and then grab the lastest comments if
Re:Impressive, but... (Score:2)
Javascript makes the request and handles the response so there is no need to do a full page refresh just to get one word back to stick in the middle of the page (or whatever).
That's the problem. The Javascript is making full HTTP requests to fetch one word. Why do you think it's
Re:Impressive, but... (Score:1)
I guess I was trying to point out that whilst stuff like XMLHTTPRequest isn't perfect it can be used to good effect in certain situations. All is not completely lost.
Re:Impressive, but... (Score:2)
Are you sure? 'RAMMS+EIN' didn't mention anything to do with AJAX (as far as I can see) but said:
"Probably the closest you can get is a form for submitting new messages, and a reloading page that displays the last few messages"
Looks like 'goynang' is right to update 'RAMMS+EIN' about AJAX.
Re:Impressive, but... (Score:4, Interesting)
Actually, Ruby's quite speedy. It's not the fastest of dynamic languages, but it's certainly on par with PHP/Python in most areas that count. Where it's not, well, that's where the incredibly easy C extension stuff comes in.
Java Web Start or wxWidgets (Score:1)
Sounds like you want either Java Web Start [sun.com] or wxWidgets [wxwidgets.org].
As for your statement: "GTK could easily be replaced by Cocoa or Win32 here". It makes me think you have never used more than one GUI framework, or tried a Java, Qt, Python (using e.g. wxWidgets) application etc. on OS X.
Native look'n'feel is only achieved by writing the application for the actual platform (often using platform frameworks, or replicating 99% of their functionality), since there are so many differences, and you can't address it by d
Re:Java Web Start or wxWidgets (Score:2)
Using the native widgets is easy enough for a cross-platform framework like the one I proposed. Of course, you do have to write an implementation for each widget toolkit, but you can start by making a portable non-native one (a la wxUniversal) as a proof of concept first.
Getting the positioning and nam
Semi-OT: Catalyst is the Perl equivalent (Score:1, Interesting)
There's a short introductory article [perl.com] on perl.com. I quote one paragraph from this article, that gives a good overview on Catalyst:
Catalyst is a new MVC framework for Perl. It is currently under rapid development, but the core API is now stable, and a growing number of projects use it. Catalyst borrows from other frameworks, such as Ruby on Rails and Apache Struts, but its main goal is to be a flexible, powerful
Shopping Cart UI suggestion (Score:1)
Right For Some (Score:1)
Prototype library copyright/license (Score:2)