Create Ext JS + Rails reusable components (widgets) with minimum effort.
This is the bare bones of the Netzke framework. Use it to build your own widgets from scratch. For pre-built widgets (like panels, grids, forms, trees, applications), see the netzke-basepack (github.com/skozlov/netzke-basepack) project.
The idea behind the Netzke framework is that it allows you write reusable client/server code. Create a widget, and then embed it (or load it dynamically) into your Ext-based applications or HTML pages. For more info, see the links below.
For the latest (“edge”) stuff, install as plugin (recommended!):
./script/plugin install git://github.com/skozlov/netzke-core.git
Otherwise, install as gem:
gem install netzke-core
To generate the migrations for Netzke persistent storage (if you want to use it):
./script/generate netzke_core
Netzke assumes that your ExtJS library is in public/extjs (which may be a symbolic link).
Here’s how to embed a Netzke widget into your Rails view.
-
In your layout, within the “head” tag, use the
netzke_init
helper to include all the necessary JavaScript and styles.<%= netzke_init %>
-
In config/routes.rb declare the Netzke routes:
map.netzke
-
In your view use the
netzke
helper wherever you want to insert a widget.<%= netzke :grid_panel, :model => "User", :columns => [:id, :name, :created_at] %>
(here we use the GridPanel widget from the netzke-basepack project)
Introduction to Netzke framework and wiki: github.com/skozlov/netzke
Twitter: twitter.com/skozlov
Tutorials: blog.writelesscode.com
Live-demo with sample code: netzke-demo.writelesscode.com
The netzke-basepack project (pre-built full-featured widgets): github.com/skozlov/netzke-basepack
Copyright © 2008-2010 Sergei Kozlov, released under the MIT license