From 0f67d6790e9fc28ac101cb74d168bda1a0952ecd Mon Sep 17 00:00:00 2001 From: Dmitry Ratnikov Date: Wed, 28 Apr 2010 06:25:59 +0800 Subject: [PATCH] Fixed the initialization to be explicitly included in ActionView::Base By the time the plugin loads, ActionView::Base has Helpers module already included, so it's missing the appended features from DynamicForm module. Fixed it by including DynamicForm module directly into the ActionView::Base. --- init.rb | 6 +++++- lib/action_view/helpers/dynamic_form.rb | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/init.rb b/init.rb index e9c3e63..c1d1a3a 100644 --- a/init.rb +++ b/init.rb @@ -1 +1,5 @@ -require 'action_view/helpers/dynamic_form' \ No newline at end of file +require 'action_view/helpers/dynamic_form' + +class ActionView::Base + include DynamicForm +end diff --git a/lib/action_view/helpers/dynamic_form.rb b/lib/action_view/helpers/dynamic_form.rb index 21dd148..b34d4bc 100644 --- a/lib/action_view/helpers/dynamic_form.rb +++ b/lib/action_view/helpers/dynamic_form.rb @@ -287,8 +287,6 @@ def error_messages(options = {}) end end - include DynamicForm - class InstanceTag include DynamicForm::InstanceTagMethods end @@ -299,4 +297,4 @@ class FormBuilder end end -I18n.load_path << File.expand_path("../../locale/en.yml", __FILE__) \ No newline at end of file +I18n.load_path << File.expand_path("../../locale/en.yml", __FILE__)