Howto: Associations with ext_scaffold (aka ExtJS with Ruby on Rails)

Jonathan Barket kindly compiled a nice howto on leveraging belongs_to associations in ext_scaffold generated user interfaces.

Check it out!

Update: The above link points to a local copy of Jonathan's article that was pulled from the Google Cache after he restructured his blog sadly dropping the original content.

Related Posts:

Berlin Ruby Crew Hard At Work Pushing Rails

Ilya Grigorik just put up a nice visualization of the Rails commit history.

At one point I spotted three members of the Berlin crew (RUG-B aka Ruby Users Group Berlin) committing to Rails:

Berlin Rails Committer Thumb.png

Github really serves as a catalyst for contributing to open source projects. Keep up the good work, everybody!

Winning the Homework Assignment from theRubyist, Issue 1

Oh, it feels good, having successfully met a challenge. I am referring to the homework assignment from theRubyist Magazine, Issue 1, the Wig-Wug challenge, of course :-) Well, the competition was not that big, I hear.

For those of you who do not remember the assignment here is a short recap:

Somehow Matz's Treasured Ruby got lost in a square playing field with unknown dimensions. The digger assigned to the task of recovering the Ruby starts his search at a random location. He can only see his immediate surroundings and is given the lateral and longitudinal distance to the Ruby before every move, not the direction mind you. The digger can choose to move left, right, up or down and will be given updated surrounding and distance information afterwards.

The playing field is populated by two kinds of creatures making the digger's life a tad more complicated. While the Fleegol is an annoying little thing that will just take the digger one additional round to get past, the Geegol is outright lethal. Neither the Fleegol nor the Geegol will move, though. So once spotted, they can be dealt with in a well-defined manner.

The task at hand obviously was to provide a implementation of the digger class in Ruby. It had to provide a move! method that given the distance and surroundings will return the desired direction of movement. The digger that would expressly recover the Treasured Ruby wins.

theRubyist, Issue 2 (to be released in February 2009) includes my "Homework Debriefing" giving all the background information.

For anyone that would like to take an even closer look, here's the complete source code of my winning solution .

Update: I just found James Edward Gray II's Wig-Wug simulator on github. So you can try out my code yourself. The star_digger.rb is already included within data/diggers. The simulator will even generate nice SVG images of every turn in the game and you can make multiple digger implementations compete -- fun, fun, fun :-)

Update 2: See the digger in action desperately fighting its way through a Geegol pested area (Geegols are dark green; Fleegols are blue; the Ruby is, surprise, red). Visualization courtesy of JEG2's simulator.

Announcing: Ext Scaffold Reloaded Plugin for Ruby on Rails

Ext Scaffold just got "Reloaded" for Christmas. Never heard of Ext Scaffold? Ok, so first things first:

The Ext Scaffold Generator Plugin is a drop-in replacement for Rails' standard Scaffold Generator. Accepting the very same options, it will generate views using data grid and form components from the Ext JS Javascript GUI framework as well as a controller acting as an Ext-compatible JSON web service. The generated code can be used as a starting point for further implementation and outlines solutions on how to integrate the Ext JS library with Rails as a backend.

When Ext Scaffold was first released earlier this year, it was a rather experimental shot at Ext/Rails integration. It still received a lot of great feedback, and more importantly it helped me gather things I would do different next time.

Ext Scaffold Reloaded is the fruit of all lessons learned since the first release, if you will. So without further ado, here are the top enhancements:

  1. One-page user interface: The Grid and the form are integrated into one single page. As no page reload is necessary when switching between grid and form, the interfaces is much more responsive.
  2. No more magic: The formerly introduced view helpers are gone. While they made the view code look very simple and elegant, they more so obfuscated what was actually going on.
  3. Easy refinement: All Javascript code is now generated explicitly and thus can be easily tweaked and refined to one's needs.

Ext Scaffold also found its new home over at github. So give it a spin and let me know what needs to be radically different in the Revolutions release ;-) .

Recommend Martin Rehfeld on Working With RailsIf you like this plugin, please consider recommending me on Working with Rails. Thank you!

Related Posts
Looking for older articles? Visit the archive.