I created my custom form builder (which inherits rails built-in form
builder) name spaced under my app module. I also assigned this form
builder to be the default action view form builder in the
environment.rb. When I am starting the server, rails is throwing
different errors some times saying unexpected kDEF expecting "<" or "\n"
or ";" or some times saying unxpected $end expecting "<" or "\n" or ";"

Following is the implementation of my code.

lib/my_app.rb
module MyApp
VERSION = 1
end

lib/my_app/form_builder.rb
require 'my_app'
module MyApp
class FormBuilder < ActionView::Helpers::FormBuilder
include MyApp::FormHelper
end #end of class
end #end of module

lib/my_app/form_helper.rb
require 'my_app'
module MyApp
module FormHelper < ActionView::Helpers::FormHelper
end #end of module FormHelper
end #end of module MyApp

and at the end of environment.rb (after initializer)
ActionView::Base.default_form_builder = MyApp::FormBuilder


Why is Rails not accepting my FormBuilder when I nest it under MyApp
module?

Btw: If I declare the FormBuilder as a standalone class, its working.

Thanks in advance.
-Satynos
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to