Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix generator

  • Loading branch information...
commit badb22c49f0f277f2524e38506df3d1b89b62548 1 parent 2e0d778
@jsy authored
Showing with 15 additions and 4 deletions.
  1. +13 −2 README.rdoc
  2. +2 −2 lib/generators/jqgrid/templates/controller.rb
View
15 README.rdoc
@@ -55,7 +55,18 @@ My gmail account : doinsist@gmail.com
o Add controller methods to ActionController::Base:
- jqgrid_post_data_for
- jqgrid_index_for
+ jqgrid_post_data_for
+ jqgrid_index_for
+ Now, a grid-enabled controller just needs:
+
+ COLUMNS = [:name, :email]
+ def index
+ jqgrid_index_for MyModel, params, COLUMNS
+ end
+
+ def post_data
+ jqgrid_post_data_for MyModel, params, COLUMNS
+ end
+
Released under the MIT license.
View
4 lib/generators/jqgrid/templates/controller.rb
@@ -14,11 +14,11 @@ class <%= class_name.pluralize %>Controller < ApplicationController
GRID_COLUMNS = [<%= columns.map {|x| ":#{x}"}.join(', ') %>]
def post_data
- jqgrid_post_data_for <%= model_name %>, params, GRID_COLUMNS
+ jqgrid_post_data_for <%= class_name %>, params, GRID_COLUMNS
end
def index
- jqgrid_index_for <%= model_name %>, params, GRID_COLUMNS
+ jqgrid_index_for <%= class_name %>, params, GRID_COLUMNS
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.