skozlov / netzke-basepack
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (3)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.autotest | Wed Apr 29 15:30:31 -0700 2009 | |
| |
.gitignore | Tue Oct 13 10:09:49 -0700 2009 | |
| |
CHANGELOG.rdoc | Mon Jan 25 13:41:21 -0800 2010 | |
| |
LICENSE | Mon Oct 12 14:51:45 -0700 2009 | |
| |
README.rdoc | Wed Dec 09 18:32:35 -0800 2009 | |
| |
Rakefile | Thu Jan 21 07:04:24 -0800 2010 | |
| |
TODO.rdoc | Tue Nov 24 10:41:47 -0800 2009 | |
| |
autotest/ | Wed Apr 29 15:30:31 -0700 2009 | |
| |
init.rb | Fri Jan 02 19:01:16 -0800 2009 | |
| |
install.rb | Sat Dec 20 19:23:39 -0800 2008 | |
| |
javascripts/ | Sun Jan 10 10:53:32 -0800 2010 | |
| |
lib/ | Mon Jan 25 13:41:21 -0800 2010 | |
| |
stylesheets/ | Tue Sep 29 12:50:14 -0700 2009 | |
| |
tasks/ | Sat Dec 27 13:54:06 -0800 2008 | |
| |
test/ | Tue Nov 17 08:32:52 -0800 2009 | |
| |
uninstall.rb | Sat Dec 20 19:23:39 -0800 2008 |
netzke-basepack
A pack of basic Rails/ExtJS widgets as a part of the Netzke framework. Live demo/tutorials on blog.writelesscode.com. Introduction to the Netzke framework and the Wiki: github.com/skozlov/netzke
Prerequisites
- Rails >= 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
- acts_as_list plugin:
./script/plugin install git://github.com/rails/acts_as_list.git
- 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 github.com/pluginaweek/plugin_test_helper
Copyright © 2008-2009 Sergei Kozlov, released under the MIT license
