Shared item
3 shares
Ext Scaffold Generator Plugin for Rails
via Ajaxian by Dion Almaer on January 22, 2008

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
endHe also has some other good articles on integrating Ext JS and Rails in general.
- Background Presentation: Ext JS and Rails, how do they get along?
- Ext JS already the 3rd most used Web Framework
Shared by: