= netzke-basepack A pack of basic Rails/ExtJS widgets as a part of the Netzke framework. Live demo/tutorials on http://blog.writelesscode.com. Introduction to the Netzke framework and the Wiki: http://github.com/skozlov/netzke = Prerequisites 1. Rails >= 2.2 2. ExtJS = 3.0.3. Its root by default must be accessible as RAILS_ROOT/public/extjs. You may symlink your Ext JS library here like this (from your app folder): cd public && ln -s ~/Developer/extjs/ext-3.0.3 extjs 3. acts_as_list plugin: ./script/plugin install git://github.com/rails/acts_as_list.git 4. netzke-core gem or plugin. Gem: gem install netzke-core Plugin (for the "edge" stuff, recommended): ./script/plugin install git://github.com/skozlov/netzke-core.git = Installation For the "edge" stuff, install as plugin (recommended): ./script/plugin install git://github.com/skozlov/netzke-basepack.git Otherwise install as gem. The gem is hosted on gemcutter. If you haven't yet enabled gemcutter, run the following: sudo gem install gemcutter && gem tumble Install the gem: gem install netzke-basepack = Usage If using as gem, include it into environment.rb: config.gem "netzke-basepack" Include mapping for Netzke controller providing Netzke javascripts and styles (in routes.rb): map.netzke To be able to use persistent on-the-fly configuration of widgets, run netzke-core generators to have the necessary migrations: ./script/generate netzke_core ... then run the migrations: rake db:migrate == Embedding widgets into Rails' view To enable Netzke widgets in Rails' views, you need to add the following helper into your layout template, inside the "head" tag: <%= netzke_init %> This will include both ExtJS-related files (JavaScript and styles), and Netzke-related files. Now let's embed a widget into a view. The following example will provide you with a grid-based scaffold for ActiveRecord-model called Book. You may generate it like this: ./script/generate model Book title:string amount:integer (don't forget to re-run the migrations after it) Now embed a widget into a view like this: <%= netzke :books, :class_name => 'GridPanel', :model => 'Book' %> == Dynamic loading of widgets TODO: this part will be covered later = Credentials Testing done with the help of http://github.com/pluginaweek/plugin_test_helper Copyright (c) 2008-2009 Sergei Kozlov, released under the MIT license