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.
VERSION = 1
class FormBuilder < ActionView::Helpers::FormBuilder
end #end of class
end #end of module
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
Btw: If I declare the FormBuilder as a standalone class, its working.
Thanks in advance.