Skip to content

simonoff/netzke-basepack

 
 

Repository files navigation

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

  1. Rails >= 2.2

  2. Netzke assumes that your ExtJS library is in public/extjs, which may be a symbolic link, e.g:

    cd public && ln -s ~/Developer/extjs/ext-3.1.1 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

Or install as 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' %>

For more examples, see netzke-demo.writelesscode.com

More info

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

Credentials

Testing done with the help of github.com/pluginaweek/plugin_test_helper


Copyright © 2008-2010 Sergei Kozlov, released under the MIT license

About

Pre-built Netzke widgets for your RIA

Resources

Stars

Watchers

Forks

Packages

No packages published