Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Lazy load `default_form_builder` if it's passed as a string #5771

wants to merge 1 commit into


None yet
3 participants

drogus commented Apr 7, 2012

It's a fix for #3341, if you pass a string it will be evaluated when it's needed.

@drogus nice, I think this could be a fix for #1196 as well, wdyt?


drogus commented Apr 7, 2012

@carlosantoniodasilva unfortunately no, #1196 is another issue. It happens because config options are copied to appropriate classes during initilization, so in order to make it work you need to set ActionView::Base.default_form_builder directly.

Ah ok, right, I think I misinterpreted this issue so, that's what you get when you read things too fast :D. Thanks.

Update: anyway, I think that not using an after_initialize block is the solution for that issue with the current setup, and one could make use of this lazy load default form builder in the proper place, without having to make sure the proper requires are in place.


rafaelfranca commented Apr 12, 2012

I agree with @carlosantoniodasilva. If we can do lazy load using string so I don't need to set the form builder using a after_initialize block. What we can do also is add in the guides something about the config options after the initialization, if we don't have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment