Agile Web Development

Build it. Launch it. Love it.

Ext scaffold

Scaffolds an entire resource, from model and migration to controller and views, along with a full test suite, just like the standard Rails scaffold generator. The ext_scaffold generator uses the Ext Javascript framwork to build the GUI elements (forms and tables).

Pass the name of the model, either CamelCased or under_scored, as the first argument, and an optional list of attribute pairs.

Attribute pairs are column_name:sql_type arguments specifying the model's attributes. Timestamps are added by default, so you don't have to specify them by hand as 'created_at:datetime updated_at:datetime'.

For example, ext_scaffold post title:string body:text published:boolean gives you a model with those three attributes, a controller that handles the create/show/update/destroy, Ext forms to create and edit your posts, and an Ext Grid index that lists them all, as well as a map.resources :posts declaration in config/routes.rb.

You need to download the Ext Javascript framework from

http://www.extjs.com/products/extjs/download.php,

and unzip it into #{RAILS_ROOT}/public/ext. Ext_scaffold was tested against version 3.0 of the ExtJS framework.

script/plugin install git://github.com/martinrehfeld/ext_scaffold.git

./script/generate ext_scaffold post # no attributes, view will be anemic

./script/generate ext_scaffold post title:string body:text published:boolean

./script/generate ext_scaffold purchase order_id:integer amount:decimal

Copyright (c) 2008 martin.rehfeld@glnetworks.de, released under the MIT license

Vitals

Home http://inside.glnetworks.de/2008/01/18/announcing-ext-scaffold-generator-plugin-for-rails/
Repository git://github.com/martinrehfeld/ext_scaffold.git
License Rails' (MIT)
Rating (22 votes)
Owner Martin Rehfeld
Created 18 January 2008

Comments

  • Avatar
    Guillermo Velasquez
    19 February 2008

    This is a nice clean implementation of ext grids and forms to rails scaffold, im impressed...

    Itll be great to cover more components from ExtJS and bring them to rails...

    I'd be glad to help you if you want to go further with improving this plugin...

    Thanks for your effort, and nice work...!!

  • Avatar
    railsguy
    20 June 2008

    uninitialized constant Mime::EXT_JSON for ext 2.1

  • Avatar
    Christopher G
    31 July 2008

    Yes, I got it too

    uninitialized constant Mime::EXT_JSON

    2.1 is the only 2.x version of Ext available.

    Please help...

    Thanks!

  • Avatar
    25 December 2008

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

  • Avatar
    Ahava
    22 June 2009

    Hello !

    This plugin roxs ! Thank you very much.

    What is the best solution to add to your plugin a search zone in top of the grid, corresponding to the fields of the model ?

  • Avatar
    11 August 2009

    Thank you, an exceptional plugin.

    I'm having troubled getting boolean variables to behave properly (checkboxes seem broken.) Anyone else seeing this?

    Everything else is very nice!

Add a comment