activegrid 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. data/LICENSE +0 -0
  2. data/README.md +28 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/javascripts/activegrid.js +73 -0
  5. data/app/assets/stylesheets/activegrid.css +4 -0
  6. data/app/controllers/active_grid/controller.rb +53 -0
  7. data/app/lib/active_grid/column.rb +42 -0
  8. data/app/lib/active_grid/grid.rb +90 -0
  9. data/app/views/active_grid/update.js.erb +1 -0
  10. data/lib/activegrid/engine.rb +10 -0
  11. data/lib/activegrid/version.rb +3 -0
  12. data/lib/activegrid.rb +4 -0
  13. data/test/activegrid_test.rb +7 -0
  14. data/test/dummy/Rakefile +6 -0
  15. data/test/dummy/app/assets/javascripts/application.js +4 -0
  16. data/test/dummy/app/assets/stylesheets/application.css +5 -0
  17. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  18. data/test/dummy/app/controllers/application_controller.rb +3 -0
  19. data/test/dummy/app/controllers/products_controller.rb +81 -0
  20. data/test/dummy/app/helpers/application_helper.rb +2 -0
  21. data/test/dummy/app/helpers/products_helper.rb +2 -0
  22. data/test/dummy/app/models/product.rb +2 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/app/views/products/_form.html.erb +33 -0
  25. data/test/dummy/app/views/products/_grid.html.erb +9 -0
  26. data/test/dummy/app/views/products/edit.html.erb +6 -0
  27. data/test/dummy/app/views/products/index.html.erb +7 -0
  28. data/test/dummy/app/views/products/new.html.erb +5 -0
  29. data/test/dummy/app/views/products/show.html.erb +25 -0
  30. data/test/dummy/config/application.rb +18 -0
  31. data/test/dummy/config/boot.rb +10 -0
  32. data/test/dummy/config/database.yml +17 -0
  33. data/test/dummy/config/environment.rb +3 -0
  34. data/test/dummy/config/environments/development.rb +18 -0
  35. data/test/dummy/config/environments/production.rb +18 -0
  36. data/test/dummy/config/environments/test.rb +19 -0
  37. data/test/dummy/config/initializers/secret_token.rb +1 -0
  38. data/test/dummy/config/initializers/session_store.rb +1 -0
  39. data/test/dummy/config/initializers/wrap_parameters.rb +7 -0
  40. data/test/dummy/config/routes.rb +5 -0
  41. data/test/dummy/config.ru +2 -0
  42. data/test/dummy/db/development.sqlite3 +0 -0
  43. data/test/dummy/db/migrate/20111015173017_create_products.rb +12 -0
  44. data/test/dummy/db/schema.rb +25 -0
  45. data/test/dummy/db/seeds.rb +3 -0
  46. data/test/dummy/log/development.log +13196 -0
  47. data/test/dummy/public/404.html +26 -0
  48. data/test/dummy/public/422.html +26 -0
  49. data/test/dummy/public/500.html +26 -0
  50. data/test/dummy/public/favicon.ico +0 -0
  51. data/test/dummy/script/rails +5 -0
  52. data/test/dummy/tmp/cache/assets/CC9/CF0/sprockets%2F2c475587282720babaa30bd125046c6d +0 -0
  53. data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  54. data/test/dummy/tmp/cache/assets/CF2/E30/sprockets%2F9690cd655384cc9f98b5a12689a04cb6 +0 -0
  55. data/test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
  56. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  57. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  58. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  59. data/test/dummy/tmp/cache/assets/D9B/900/sprockets%2F47e1b36aecf9211f751cad5cbd1f7466 +0 -0
  60. data/test/dummy/tmp/cache/assets/DA1/CB0/sprockets%2Fd873f0f0b7a49a21b56a28e565e7deea +0 -0
  61. data/test/dummy/tmp/cache/assets/DA4/2A0/sprockets%2Ff78aae8f781bb900e68ba4c9721fbe22 +0 -0
  62. data/test/dummy/tmp/cache/assets/DAD/F00/sprockets%2Fed0c338098c67fff252ea6f6c279ca4f +0 -0
  63. data/test/dummy/tmp/cache/assets/DF9/B10/sprockets%2Ffc21b5aee1c95934ed1b41ac05eeee87 +0 -0
  64. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  65. data/test/dummy/tmp/cache/assets/E5B/7A0/sprockets%2F5c84af44bfcbcc581dd75a9b19beeac1 +0 -0
  66. data/test/dummy/tmp/pids/server.pid +1 -0
  67. data/test/integration/navigation_test.rb +6 -0
  68. data/test/test_helper.rb +8 -0
  69. metadata +203 -0
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,17 @@
1
+ development:
2
+ adapter: sqlite3
3
+ database: db/development.sqlite3
4
+ pool: 5
5
+ timeout: 5000
6
+
7
+ test:
8
+ adapter: sqlite3
9
+ database: db/test.sqlite3
10
+ pool: 5
11
+ timeout: 5000
12
+
13
+ production:
14
+ adapter: sqlite3
15
+ database: db/production.sqlite3
16
+ pool: 5
17
+ timeout: 5000
@@ -0,0 +1,3 @@
1
+ require File.expand_path('../application', __FILE__)
2
+
3
+ Dummy::Application.initialize!
@@ -0,0 +1,18 @@
1
+ Dummy::Application.configure do
2
+ config.cache_classes = false
3
+
4
+ config.whiny_nils = true
5
+
6
+ config.consider_all_requests_local = true
7
+ config.action_controller.perform_caching = false
8
+
9
+ config.action_mailer.raise_delivery_errors = false
10
+
11
+ config.active_support.deprecation = :log
12
+
13
+ config.action_dispatch.best_standards_support = :builtin
14
+
15
+ config.assets.compress = false
16
+
17
+ config.assets.debug = true
18
+ end
@@ -0,0 +1,18 @@
1
+ Dummy::Application.configure do
2
+ config.cache_classes = true
3
+
4
+ config.consider_all_requests_local = false
5
+ config.action_controller.perform_caching = true
6
+
7
+ config.serve_static_assets = false
8
+
9
+ config.assets.compress = true
10
+
11
+ config.assets.compile = false
12
+
13
+ config.assets.digest = true
14
+
15
+ config.i18n.fallbacks = true
16
+
17
+ config.active_support.deprecation = :notify
18
+ end
@@ -0,0 +1,19 @@
1
+ Dummy::Application.configure do
2
+ config.cache_classes = true
3
+
4
+ config.serve_static_assets = true
5
+ config.static_cache_control = "public, max-age=3600"
6
+
7
+ config.whiny_nils = true
8
+
9
+ config.consider_all_requests_local = true
10
+ config.action_controller.perform_caching = false
11
+
12
+ config.action_dispatch.show_exceptions = false
13
+
14
+ config.action_controller.allow_forgery_protection = false
15
+
16
+ config.action_mailer.delivery_method = :test
17
+
18
+ config.active_support.deprecation = :stderr
19
+ end
@@ -0,0 +1 @@
1
+ Dummy::Application.config.secret_token = '591b21271a9c2bae651bd4b68476dd925f1498d12032e8fb3c2afaa65ffdfdc6e59f3b7350d9eca6159a057c85add04b25733bb978c483b3c0d7596465e2b897'
@@ -0,0 +1 @@
1
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,7 @@
1
+ ActiveSupport.on_load(:action_controller) do
2
+ wrap_parameters format: [:json]
3
+ end
4
+
5
+ ActiveSupport.on_load(:active_record) do
6
+ self.include_root_in_json = false
7
+ end
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ resources :products
3
+
4
+ mount ActiveGrid::Engine => "/activegrid"
5
+ end
@@ -0,0 +1,2 @@
1
+ require ::File.expand_path('../config/environment', __FILE__)
2
+ run Dummy::Application
Binary file
@@ -0,0 +1,12 @@
1
+ class CreateProducts < ActiveRecord::Migration
2
+ def change
3
+ create_table :products do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.decimal :price
7
+ t.integer :quantity
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20111015173017) do
15
+
16
+ create_table "products", :force => true do |t|
17
+ t.string "name"
18
+ t.text "description"
19
+ t.decimal "price"
20
+ t.integer "quantity"
21
+ t.datetime "created_at"
22
+ t.datetime "updated_at"
23
+ end
24
+
25
+ end
@@ -0,0 +1,3 @@
1
+ Product.create(name: "Gizmo")
2
+ Product.create(name: "Widget")
3
+ Product.create(name: "Chocolate Bar")