Skip to content

Commit

Permalink
Fix for undefined methods included in ActionView
Browse files Browse the repository at this point in the history
- Include Datagrid::Helper in ActionView::Base in lib/datagrid.rb
- Include Datagrid::FormBuilder in ActionView::Helpers::FormBuilder in lib/datagrid.rb
- Add action_view to spec_helper
  • Loading branch information
yrgoldteeth committed May 3, 2012
1 parent b8929e7 commit faf446c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/datagrid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ module Datagrid
autoload :Ordering

autoload :Helper
ActionView::Base.send(:include, Datagrid::Helper)

autoload :FormBuilder
ActionView::Helpers::FormBuilder.send(:include, Datagrid::FormBuilder)

autoload :Renderer

autoload :Engine
Expand Down
1 change: 0 additions & 1 deletion lib/datagrid/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,4 @@ class Error < StandardError
end
end

ActionView::Helpers::FormBuilder.send(:include, Datagrid::FormBuilder)

2 changes: 1 addition & 1 deletion lib/datagrid/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def datagrid_column_classes(grid, column)
end
end
end
ActionView::Base.send(:include, Datagrid::Helper)

1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))

require "active_record"
require 'action_view'
require "mongoid"
require "mongo_mapper"
require 'datagrid'
Expand Down

0 comments on commit faf446c

Please sign in to comment.