Skip to content

glennswest/activejquery

Repository files navigation

Activejquery
============
Oct  15,2009 - Fixed Keyword problems for Ruby 1.8
               Fixed "/" problem breaking javascript includes with namespace
               
Oct  10,2009 - Start adding better assoc support
Oct  10,2009 - Updated to jquery-ui-1.7.2 and jggrid 3.5.2
June 28,2009 - Renameed localsel automatic divid to tablename_select
               Remove editurl when not in edit mode
               Get rid of autowidth on localsel mode
               Setup to hide localsel grids on initial load
               Change -pager to _pager for consistancy
               Fixup the naming convention to better handle has_one convention
               Added flag to column info to tell us columns that are associations,
                       plus association_name,type,table.
               Added virtual column for "name" of _id fields while processing columns.
June 27 2009 - Remove commented code a bit.
               Fixup if edit mode not to display icons for add/delete
               Added detection of selectfield - Either field called name, or first
                     non id field in table
               Added gridtype to possible javascript parameters
               Added grid generator support for @gridtype=typeofgrid
                     typeofgrid = main      - Normal Grid
                     typeofgrid = localsel  - Limited Grid for selecting a single item, with only "name" field, no edit
              Added html generation to generate has_one relationship
June 8 2009 - Fixup grid generator to have parameters to be passed in
                        ?subof=tablename - Indicating that we ard a subtable, and of which table
                                           The tablename is the parenttable
                        &divid=name      - Indicated the divid of the grid to be generated
                                           For a subgrid its parenttable_childtable
June 6 2009 - Cleaned up grid javascript
              Implemented first version using hidden fields
              Moved all grids to be separate .js files
              Fixed up divid so grids are re-useable,
                    and multiple instances can be on one page
              Added first level of support for association
May 30 2009 - Moved to using JqGrid 3.5 beta
                 Removed alpha jqgrid subdir
                 Removed jqgrid loader
                 updated show.erb
May 15 2009 - Fixed ProtectFromForgery for add and delete.
              Moved from using editdata for Forgery Protection,
                 to using the edit url, for all edit/add/delete.
              Fixed Paging offset that was not showing the first
                 10 records.
              Fixed a typo where the wrong model was used for updates
              Merged in public/css and javascripts code to plubin
              Added install.rb to copy needed files
              Added support for boolean fields
              Fixed runtime to disable edit on activerecord magic fields,
                    such as date_created, date_updated, etc
May 14 2009 - Added support for one line controller.
              Added Support for ProtectFromForgery


Environment: 
=======
Designed for Ruby 1.9.1 and Rails 2.3.2
Initial testing done for Ruby 1.8.x

Formatting Notes:
================
Activejquery uses a default view to style the grid, 
this is in views/activejquery/show.erb
If you have added addition default styles/views, you may see the
page number box to be squashed. 


Routes
=======
You must add a active resource route in config/routes.rb

map.resources :airstate

Namespaced Controller route example

  map.namespace :adminspace do |adminspace|
      adminspace.resources :user
      end

Example
=======

Example Controller:
Class AirstateController < ApplicationController
#before_filter :login_required

      active_jquery :Syslog
             
end

Where Syslog is the name of the model.

Installation:
ruby script/plugin --verbose install git://github.com/glennswest/activejquery.git

Note: This (git based plugins) is broken in ruby 1.9.1 unless you do a patch.
See:
http://mentalpagingspace.blogspot.com/2009/05/ruby-scriptplugin-git-does-not-work-in.html
https://rails.lighthouseapp.com/attachments/90768/plugin_mkdir_p.diff

TODO
===========
1. Relationships - HASBM
2. Relationships - Belongs to
3. Adding virtual columns for relationships
4. Customization
5. More Edit Types
6. Automatic route creation
7. Automatic javascript to connected related grids
8. Details docs - In planning now
9. Fix localsel table to use @options={:class_name=>"User"}, and @name=:supervisor
~                        

Copyright (c) 2009 Glenn S West, released under the MIT license

About

A set of Jquery Tools for Restful Jquery Usage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published