Activate your free membership today | Log-in

Wednesday, January 23rd, 2008

Ext Scaffold Generator Plugin for Rails

Category: Examples, Rails, Ruby, Sencha

<p>

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:

RUBY:
    # GET /posts
    # GET /posts.ext_json
    def index
      respond_to do |format|
        format.html     # index.html.erb (will fire ext_json request)
        format.ext_json { render :json => Post.find(:all).to_ext_json }
      end
    end

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

Related Content:

  • Learn about Ruby on Rails programming
    Rails, as the combination of the Ruby language and the Rails developer framework is called by its coder legions, is easier to work with than Java. It...
  • Ruby on Rails Tutorial
    Ruby on Rails has enjoyed near cult status among programmers who converted to Ruby from Java. Learn about the lightweight framework that many...
  • How Ruby on Rails and REST go together
    The Rails framework for building Web applications in the dynamic Ruby language is now focused on the REST approach, says the author of a new book of...
  • Hot skills: Ruby on Rails 2.0
    Rails is not the only framework for Ruby, and Ruby is not the only language which uses Rails. Rails has also been ported to Javascript by a team at...
  • Hot skills: Ruby on Rails
    Skills for IT professionals: Ruby on...

Posted by Dion Almaer at 6:54 am
3 Comments

+++--
3.9 rating from 35 votes

3 Comments »

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.

Cheers,
Martin

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.