Slashdot Mirror


Ajax On Rails

mu-sly writes "Ajax and Rails - probably two of the biggest buzzwords in web development at the moment. In this article over at ONLamp, Curt Hibbs introduces the incredibly powerful Ajax support that is part of the Ruby on Rails web application framework. It's a great read, and serves as a gentle introduction to the cool stuff you can accomplish with ease using the Ajax features of Rails."

23 of 235 comments (clear)

  1. Rails, great for those fed up with J2EE. by newdamage · · Score: 5, Interesting

    I'm sure many developers like myself have a day job that probably involves J2EE. The first time I did the iniitial tutorials for Rails several weeks ago I was blown away. Connecting to a database is not susposed to be this easy.

    Even when using newer frameworks like Spring, Tapestry and Hibernate (I hate you so much Struts) Rails still manages to be easier.

    I highly suggest any developers looking for a change of pace at least give Ruby on Rails a few hours of your evening. While it's not nearly as comprehensive as Java, it's gaining libraries and functionality by leaps and bounds.

    And just so I don't get labeled as a Rails fanboy/Java basher: Rails is not perfect, I still would recommend using J2EE for large corporate projects. It's just a much more mature solution with less unknowns. I think Rails needs another year at least before people are ready to really give it a shot in the corporate environment.

    --
    ce n'est pas un Sig.
    1. Re:Rails, great for those fed up with J2EE. by Cyberax · · Score: 3, Interesting

      Ruby is easier. Until you try to do something even moderately complex.

      Our company recently tried to do a web-project (workflow management application for a publishing house) based RoR. It was a spectacular failure - LOTS of things are mostly absent from RoR: caching and transaction support, object-relational mapping is inferior (yes, ActiveRecord is NOT enough), etc.

      RoR is nice, but it needs lots of polishing and some redesign. In its present state RoR can't be compared with J2EE solutions, they are far more powerfull and _flexible_.

    2. Re:Rails, great for those fed up with J2EE. by sucresemoule123 · · Score: 5, Informative

      RoR has caching : here and supports transactions : here

    3. Re:Rails, great for those fed up with J2EE. by marcello_dl · · Score: 3, Interesting

      hmmmmm troll alert?

      Ruby can't do complex things java can??? You meant rails, probably, and such confusion of terms is not a good sign.

      Have you checked out the latest rails versions' API? I see transaction support and caching of db data and cgi actions too.

      As for the 'inferior' object relational mapping: indeed Active record tries to keep things simple: I'm grateful for it. Rails developers got too far sometimes, as you see if you have a column named 'type' in your tables ;)
      But, that's not being inferior, it's being different. If your app requires convolute mappings, either extend active record to suit your needs or do without it (possibly dropping rails altogether and wasting precious ram with a JVM ;) ).

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    4. Re:Rails, great for those fed up with J2EE. by zorander · · Score: 4, Informative

      Enterprise software is a different game. Rails is pretty all around terrible at integrating with non-rails-intended database schemas which are plentiful in any enterprise situation.

      I'm going to overlook the fact that a flexible caching mechanism has been in place since pre-snowdevil (maybe february) and transaction support was added at some point before the last time I worked with rails (late april). Keep in mind that it's still pre-1.0 and beta and not yet feature-complete. Criticizing it for a lack of features it supports, though, is in poor taste.

      Furthermore, almost all rails development at this point has been executed using very small (5 people) core teams. J2EE supports large scale development because it was designed for it. Rails was designed to let a relatively small number of people write an agile application using the set of paradigms which rails was built on. Coming at it from an "I use java in the enterprise and couldn't plug rails in its place tomorrow" is a little bit unfair, because in the same sense, I couldn't just drop J2EE onto my own desktop and start developing with it tomorrow. (Not to mention that my boss would not even begin to authorize such an expenditure for one developer on one product).

      I see rails more as a contender to PHP than to J2EE. J2EE and rails are not really comparable in the same market. Sure, rails beats the crap out of J2EE when you've got 1-3 developers on the project, and inversely, when there's more than 10, J2EE has a clear advantage. Coming from java, you're likely to miss many of the benefits of metaprogramming in rails. Even coming from python (a somewhat similar language to ruby), I was a bit startled at some of the techniques being used.

      Your project might have failed, but I'm not sure it was completely rails that caused it. AR is very easily extensible (in a matter of hours, usually) to do all sorts of more enterprise-java-like things. Ruby's dynamic messaging and open classes makes that a much simpler affair than it would be in java. Why didn't you extend it to meet your needs? Also, how did you miss the fact that caching and transactions have been there for a while? Were you trying to shoehorn rails onto an old schema? Did you have prior ruby programming experience or were you learning as you went? Did you have prior experience in a dynamically typed language writing an app of similar complexity? Nothing is going to make the solution of a hard problem easy. Some things can make it more pleasant, if used correctly.

    5. Re:Rails, great for those fed up with J2EE. by abulafia · · Score: 3, Interesting
      Were you trying to shoehorn rails onto an old schema?

      This, I think, is the crux.

      My company has a library, too, that makes certain assumptions about the DB. We're really wicked-fast when using it, when building an app from the gound up. It has hooks for overriding some assumptions, so we can shoe-horn it in to some other projects. But if the DB is hopeless, the game is over, and we have to do things like everyone else.

      And nearly every company out there has a hopelessly messy DB, that can't be refactored because of X, where X is legacy apps, no money, management resistance, [...]

      Hell, even Hibernate/middlegen has a problem related to this: all it takes is one clueless app developer that scorns DB constraints, and you have a Situation that can cost 10s of K to fix.

      Rails is neat (I'm a pretty big perl bigot, and I like it), but it isn't designed for integration. Folks playing around with it should recognize that up front, so that they don't try to do the wrong thing with it.

      --
      I forget what 8 was for.
    6. Re:Rails, great for those fed up with J2EE. by Cyberax · · Score: 4, Interesting

      First, you have some misconeptions about J2EE.

      True, you can't just drop J2EE on your desktop because there's no such _thing_ as J2EE. J2EE is a set of standards (which contains just about everything).

      The only things you need to start developing J2EE applications are: Tomcat (http://jakarta.apache.org/tomcat/index.html), optionally a web-framework (like http://jakarta.apache.org/tapestry/index.html) and you can start developing tomorrow (if you know Java of course) and a decent IDE (http://www.eclipse.org/). It will cost you about $0.

      Java has some metaprogramming featues starting from version 1.5. Right now we're writing application in C++ and Python, so I don't miss metaprogramming features :)

      RoR is extensible, but some features are just very hard to implement: maintaning persistent object identity, complex mappings support, distributed caching and long-running transactions with optimistic locking.

      We had previous expirience in dynamic languages (Python, Perl, PHP). This project was a sort of expirement - we wanted to see what can be done with RoR.

    7. Re:Rails, great for those fed up with J2EE. by milesegan · · Score: 4, Informative

      Rails supports optimisting locking out of the box. Just add a lock_version column to your table and it will do the rest.

  2. Ruby on Rails as a threat to PHP? by Sv-Manowar · · Score: 4, Insightful

    Every time I see material surrounding Ruby on Rails, I'm further convinced that it could be the web application programming foundation that starts to displace PHP as developers start to look at the transition from PHP 4 to PHP 5. Getting an increased install base for ruby on rails, as is the case with php (a fairly difficult task, admittedly) would definitely help no end in increasing the framework's popularity, at least amongst those programming smaller web applications.

  3. Rails book from the Pragmatic Bookshelf by gavri · · Score: 4, Informative

    Get the Beta book http://pragmaticprogrammer.com/titles/rails/index. html If you're interested in Rails at all, this book is all you need.

    1. Re:Rails book from the Pragmatic Bookshelf by mav[LAG] · · Score: 5, Informative

      Agreed 100%. I bought it last week. Don't be fooled by its "beta" status - it's a thoroughly well written introduction to Rails that takes you through everything you need to know - including building a REAL application (a shopping cart) from start to finish.

      I also bought Programming Ruby by the same author because I want to do more with Ruby than just Rails, but this isn't necessary for those who just need Rails - all Ruby constructs and idioms are cross-referenced with an included introduction to the language.

      --
      --- Hot Shot City is particularly good.
  4. Which is the bigger irony: by smittyoneeach · · Score: 3, Insightful
    Then Microsoft created XMLHttpRequest in Internet Explorer 5, which let browser-side JavaScript communicate with the web server in the background without requiring the browser to display a new web page. That made it possible to develop more fluid and responsive web applications. Mozilla soon implemented XMLHttpRequest in its browsers, as did Apple (in the Safari browser) and Opera.
    XMLHttpRequest must have been one of the Web's best kept secrets. Since its debut in 1998, few sites have used it at all, and most developers, if they even knew about it, never used it. Google started to change that when it released a series of high-profile web applications with sleek new UIs powered by XMLHttpRequest.
    a) Microsoft as a first-mover in a technology, or
    b) Microsoft's own technology being used by Google to loosen Redmond's deathgrip on the market?
    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    1. Re:Which is the bigger irony: by Buzzard2501 · · Score: 3, Informative

      AFAIK, Google doesn't use the XMLHttpRequest for any of their applications.

      Google Suggest uses XMLHttpRequest, while Google Maps uses a iframe

      --
      Real programmers don't comment their code. It was hard to write, it should be hard to understand.
  5. Dont Forget Zope by salimfadhley · · Score: 3, Insightful

    Of course Rails isnt the only completely F/OSS web application framework; Rails is best when you want to put relational data online: It's edge is it's simplicity.

    On the other hand remember Zope - If you can get your head around Aqusition, the ZODB and Product Deveopment then Zope is a super-fast development platform.

  6. it's an illusion alright by udderly · · Score: 4, Funny

    From the article:The most visually impressive of these is Google Maps, which gives you the illusion of being able to drag around an infinitely sizable map in its little map window.

    It's illusory alright, when I start at the US and scroll due west the first thing that I come to is the UK. Where'd all the other countries go?

    1. Re:it's an illusion alright by MyLongNickName · · Score: 4, Funny

      All the other countries don't really exist. You see, Oceana needs to have enemies in order to keep the people focused, and subservient to the government. It is all part of the plan.... ... oh shit... its the Ministry of Love. See you in a few years...

      --
      See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
  7. AJAX meme by broward · · Score: 3, Informative

    The rise in AJAX is almost solely due to the recent AdaptivePath article. I'm not sure it's a major trend.

    http://www.realmeme.com/miner/technology/ajaxDejan ews.png

    However, Ruby on Rails is clearly rising,
    moving steadily upward for over a year. Thanks to a reader for bringing this to my attention.

    http://www.realmeme.com/miner/technology/hibernate vsrubyDejanews.png

    1. Re:AJAX meme by shashark · · Score: 3, Informative
      From http://en.wikipedia.org/wiki/AJAX

      There have been some critics of the term AJAX, claiming that the Adaptive Path consultancy who created it are using it as a marketing vehicle (and as a meme) for previously used techniques

      It has been pointed out that the AJAX technologies did not have a common name before, and that some welcome a unifying term for the process. However it is also reported that the Google engineers who have created the most prominent applications using this technique consider their technologies as 'Javascript'

      AJAX is not a new approach of building software. From a higher perspective the presentation layer is like a form and a programming layer behind handling the events, commonly known in programming terms as MVC. This kind of programming is very well known in older programming environments like Delphi, MFC, Visual Basic, Oracle ADF, and Windows Forms, just to name a few. Applications using this model of programming have been around for years: Microsoft Outlook Web Access using WebDAV and the Web based ERP system P2plus using web services directly from the browser. However, because there are no standards available for the communication model behind previous implementations, all use proprietary extensions.

      A new aspect to AJAX is that there are now multiple browsers that can be used to realize this type of application, as opposed to earlier technologies which were frequently limited only to Microsoft's Internet Explorer.

  8. Rails changes the whole Web development game by Peter+Cooper · · Score: 3, Interesting

    Most of this product comparison site was developed in Ruby on Rails within the last two months, and it already does more than Froogle, has more search features, etc.

    I've also developed a large marketing system for the restaurant industry in Rails which lets restauranteurs develop e-cards, e-gifts, and send them to their customers on certain days.. or certain days away from their birthdays, etc.. and that will be going fully live soon.

    My 10,000 user strong RSS Digest will be making the leap to Rails soon (July 1st) and this is a system driving over half a million uses a day.

    I developed a del.icio.us-style tagged Code Snippets site in Rails within two days! It's had further refinements since then, but less than two weeks after launch, it was getting thousands of pageviews a day and hundreds of visitors a day from Google.

    I was ready to give up development work 6 months ago, and now it's the most fun and profitable work out there for me. Ruby on Rails deserves the attention it's getting. You can put together your ideas in a fraction of the time you'd have ever imagined.

  9. Will that be 5 or 10 years experience? by GoofyBoy · · Score: 4, Funny

    Time to add Ajax and Rails on my resume!

    (To all potential employeers: I kid!)

    --
    The surprise isn't how often we make bad choices; the surprise is how seldom they defeat us.
  10. Get the book by Ridgelift · · Score: 3, Informative

    I first heard of Ruby on Rails here on Slashdot. Although Rails is dead simple once you get it, getting to the "ah ha" point is a bit of a steep climb.

    If you want to learn Ajax in Rails, the best thing I've read has been Dave Thomas' new book "Agile Web Development with Ruby on Rails". The author of Ruby on Rails itself, David Heinemeier Hansson, is also a co-author. Great book, absolutely fantastic web development framework.

  11. ASP.Net 2.0 by DigitlDud · · Score: 3, Informative

    ASP.NET 2.0 does this also. You can define client callbacks on web controls which let you run code on the server-side and get the results back without reposting the page.
    http://www.developer.com/net/asp/article.php/35068 96

  12. No, you hold the hype for 3 months. by Some+Random+Username · · Score: 4, Insightful

    I am sick of seeing this excuse. You can't run around the internet screaming how rails is the greatest thing since the wheel, and how it renders java obsolete because its 100x faster to work with, and then say "its not done" when people actually try to use it. If you are ready to hype something and tell everyone how great it is, then you need to be ready to accept criticism too. If we can't compare it yet because it isn't finished, then stop running around telling us how great it is and how we should all be using it.