I heart Merb
Yes every new framework sets my heart a flutter, but this time it’s for real.
Developing Flex/Flash on top of Rails? What if you could get ActiveRecord and RESTful routing at almost eight times the speed with 75% less RAM? How about all that and real concurrency, including true multiple file upload? All of the above without the Rails attitude? You need to get you some Merb.
Models look the same:
class Photo < ActiveRecord::Base
belongs_to :photo_roll
acts_as_list :scope => :photo_roll
def to_json
self.attributes.to_json
end
end
Controllers look the same:
class PhotoRolls < Application
def index
@photo_rolls = PhotoRoll.find(:all)
render :js => @photo_rolls.to_json
end
end
Then consume away in Flex…
public function find() : void
{
var svc:JSONRESTService = new JSONRESTService();
svc.url = "/photo_rolls"
svc.sendRESTfully( "index", null, onResult, onFault );
}
That’s a custom JSON REST Service which will be showing up in a future tutorial.
or use HAML as a built in templating engine for all your HTML needs.
Merb!
Merb Docs!
Merb Tutorial!
This entry was written by
Alastair, posted on
June 27, 2007 at 10:53 pm, filed under
Flash,
Flex,
Merb,
Ruby. Bookmark the
permalink. Follow any comments here with the
RSS feed for this post.
or leave a trackback:
Trackback URL.
© Copyright 2006 - 2012 Alastair Dawson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 Comments
Very insightful. I was initially turned off by Merb because of the absence of all of the view helpers, but if your view is Flex, who cares? I’ll definitely be taking a look at Merb.
I rewrote my blog in Merb and I love the experience. If you code your Javascript unobtrusively with Prototype.js and LowPro, you won’t miss Rails’ Javascript Helpers. We’ve got a simple but functional set of form helpers into Merb.
You can still do respond_to and send Javascript back in response to Ajax calls.
And it’s super fast, both in development and production mode.