Wednesday, January 23rd, 2008

Ext Scaffold Generator Plugin for Rails

Category: Examples, Rails, Ruby, Sencha

Martin Rehfeld has released a Rails plugin that generates Ext JS scaffolds

The Ext Scaffold Generator Plugin provides a custom MIME type alias :ext_json to be able to handle requests from the Ext frontend separately. The generated controllers show how to do this.

To make data delivery to the Ext frontend easy, the plugin extends the Array and ActiveRecord::Base classes to provide a to_ext_json method. Here’s a simplified example of a potential index method in a PostsController:

  1. # GET /posts
  2. # GET /posts.ext_json
  3. def index
  4.   respond_to do |format|
  5.     format.html     # index.html.erb (will fire ext_json request)
  6.     format.ext_json { render :json => Post.find(:all).to_ext_json }
  7.   end
  8. end

He also has some other good articles on integrating Ext JS and Rails in general.

Posted by Dion Almaer at 6:54 am

3.8 rating from 36 votes


Comments feed TrackBack URI

Perfect timing. We are currently building an Ext App with Rails and this comes in handy. Thanks for the article!

Comment by Gordon — January 23, 2008

Hi Dion, thx for the friendly coverage on my Ext Scaffold Generator. I just added another article to the Ext and Rails series on GL Networks Inside: Tutorial: Howto use the Ext JS Treeview (Ext.tree) with Ruby on Rails

Check it out if you get a chance.


Comment by MartinRehfeld — January 26, 2008

The freshly released version aka “Ext Scaffold Reloaded” improves things considerably: better UI, improved performance, clearer code-generation. Find details in the Announcement of Ext Scaffold Reloaded. Enjoy!

Comment by MartinRehfeld — December 25, 2008

Leave a comment

You must be logged in to post a comment.