Vixiom Axioms

March 5, 2008

Interesting Links: YUIRails, Ebb faster than Mongrel and thin

Filed under: Ajax, JavaScript, Merb, Ruby on Rails Alastair @ 7:23 am

The JavaScript library I use most after prototype is YUI so a big thanks to Chetan Patil for making it much easier to use in Rails.

Ruby Inside has a post on Ebb a small and fast web server for hosting Rails and Merb applications (and soon Django).

Ebb is a small, extremely high performance Web / HTTP server designed specifically for hosting applications built upon Web frameworks such as Rails and Merb (and, in future, apps on other non-Ruby frameworks.) The design is event based (similar to that used by Ruby daemons that use EventMachine) but Ebb itself is written in C and dispatches requests to Rack adapters. This is a real leapfrog over the popular Mongrel and Thin daemons which are primarily written in Ruby, and results in scary levels of performance.

Digg! submit Interesting Links: YUIRails, Ebb faster than Mongrel and thin to stumbleupon.com submit Interesting Links: YUIRails, Ebb faster than Mongrel and thin to del.icio.us submit Interesting Links: YUIRails, Ebb faster than Mongrel and thin to reddit.com Like this post? subscribe to the feed.

February 6, 2008

Adobe Compares Flex and Ajax

Filed under: Ajax, Flash Remoting, Flex, RIA Alastair @ 9:12 am

The comparison is coming from one of the horses mouths so take it with a grain a salt. That said I think Adobe tried not to step on some Ajax toes and didn’t make a strong enough case for Flex.

It’s a good basic overview but there are a couple of things I disagree with;

Why use ColdFusion for all the examples? A shrinking minority still use it but all the ColdFusion guys I know switched to either PHP or Rails over the last two years. I think it’s best to use PHP for comparisons like this as everyone has used it and can easily translate PHP to their favorite language.

Even though Adobe won’t admit it the reason they’re doing the comparison is to show off that Flex does Ajax like things. At the end of the article they break down the pros and cons of each, and if I were an Ajax developer I’m not sure I would be convinced to try Flex. Their pros for Flex are that it’s easier to develop with because of an IDE, which is true but there are Ajax IDEs now (which the author mentions later), the other is performance which ends up a tie because Ajax in a browser can handle large amounts of text better.

If I were writing it my pro Flex arguments would have included;

Consistent results No matter your browser Flash is Flash so Flex is Flex. Except for extremely rare circumstances your app is going to behave as expected.

Class Mapping Flash Remoting can map server side classes. Objects don’t need to be converted into XML first to go over the wire and they arrive as native objects ready to use (no need to parse and convert them back again).

Not only Remoting If you do want to consume XML Flex can do that too, or JSON, or REST services etc. If you already have some kind of service set up Flex could slide in and replace Ajax so you could make use of it’s…

Advanced Multimedia Features Video, Audio, and Vector Animation are things you just cant do with JavaScript, it’s the way content on the Intertubes are moving and a big reason to use Flex.

My pro Ajax arguments would include;

Frameworks The sheer number of Ajax frameworks dwarfs anything Flex has right now.

User Base The Flex community is growing but the JavaScript community is huge, you’re much more likely to find help getting started or solving a problem with Ajax.

Digg! submit Adobe Compares Flex and Ajax to stumbleupon.com submit Adobe Compares Flex and Ajax to del.icio.us submit Adobe Compares Flex and Ajax to reddit.com Like this post? subscribe to the feed.

January 18, 2008

Rails 2.0 and link_to_remote :with

Filed under: Ajax, JavaScript, Ruby, Ruby on Rails Alastair @ 11:22 am

I’m moving an old app to Rails 2.0 and other than fixing some routes Ajax calls with link_to_remote and the :with parameter was the only thing that gave me some trouble. In the old version I was grabbing the current value of a drop down list with Prototype and passing it along using :with like this

<%= link_to_remote image_tag(cms/add_16.gif, :id => color_add),
      :url => { :controller => colors, :action => new_ajax,
      :id => @product.id },
      :with => { color_id: $F(’color_id’) }
%>

But in Rails 2.0 the parameter wouldn’t go along for the ride, it seemed that the new authenticity_token that gets sent with Ajax calls was messing things up. Here’s the fix

<%= link_to_remote image_tag(cms/add_16.gif, :id => color_add),
      :url => { :controller => colors, :action => new_ajax,
      :id => @product.id },
      :with => ‘color_id=’+$F(’color_id’)
%>

I freely admit JavaScript/Ajax is my weakest language so if I was doing it wrong the entire time let me know :)

Digg! submit Rails 2.0 and link_to_remote :with to stumbleupon.com submit Rails 2.0 and link_to_remote :with to del.icio.us submit Rails 2.0 and link_to_remote :with to reddit.com Like this post? subscribe to the feed.

Powered by WordPress