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

15 of 235 comments (clear)

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

  3. 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.
  4. Re:Dont Forget Zope by Anonymous Coward · · Score: 1, Informative

    It's also an extremely heavy-weight platform, especially if all you're looking to do is simple web applications. In addition, running it alongside Apache is a bit of a resource hog.

    I'm not saying it's bad, but Rails and Zope are two completely different things. Comparing CGI to something that has its own built-in relational database, FTP server, et. al. doesn't make much sense.

  5. Re:Which is the bigger irony: by Anonymous Coward · · Score: 1, Informative
    AFAIK, Google doesn't use the XMLHttpRequest for any of their applications.

    Well, you don't know very much, do you?

    http://maps.google.com/mapfiles/maps.keyhole.6.saf ari.js
    // Copyright 2005 Google function Oa(){} Oa.create=function(){if(typeof ActiveXObject!="undefined"){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}if(t ypeof XMLHttpRequest!="undefined"){return new XMLHttpRequest()}return null} ;function Aa(){}
    http://www.scss.com.au/family/andrew/opera/gmail/
    When Google introduced Gmail on 2004-04-01, they did not initially support Opera. The main sticking point was Opera's lack of XMLHttpRequest support.
  6. Re:Rails, great for those fed up with J2EE. by sucresemoule123 · · Score: 5, Informative

    RoR has caching : here and supports transactions : here

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

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

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

    > Ruby is easier.

    yes

    > Until you try to do something even moderately complex.

    nothing is easy when it's complex

    > caching

    nope, its there

    > transaction support

    yep it's weak.

    > object-relational mapping is inferior

    Isn't any OR mapper slow/bloated and really just a starting point?

    > RoR is nice

    yes :)

    > but it needs lots of polishing and some redesign.

    it's not 1.0 yet

    > In its present state RoR can't be compared with J2EE solutions, they are far more powerfull and _flexible_.

    I don't code Java professionally, so I don't know. But Rails ain't 1.0 yet. Check back in 3 months ;-)

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

  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. Re:Article's examples dont work by matchboy · · Score: 2, Informative

    That's the default Rails error page. Wasn't keeping up with the /. load with the default settings. Try again now.

    --

    Robby Russell
    PLANET ARGON
    Robby on Rails
  13. What are you talking about? by Some+Random+Username · · Score: 2, Informative

    I very clearly stated that you can cache over the network, and pointed out why a network cache like memcached is faster than an RDBMS. Your post has nothing to do with what I said, so why is it a reply to me? And you can just pull an object from the cache with memcached, because every time you update the db, you also update the cache.