ankane / blazer

Business intelligence made simple
MIT License
4.5k stars 471 forks source link

[Idea, PR offer] Inheriting from ApplicationController can cause issues, consider configurable base controller? #449

Closed dhnaranjo closed 9 months ago

dhnaranjo commented 11 months ago

Yowhattup? My ApplicationController sets a default FormBuilder that is customized to my liking. This includes changing the arity of FormBuilder#label, which is probably a bad idea but here we are. Since Blazer::BaseController inherits from ApplicationController I hit an ArgumentError when on the New or Edit query page.

My workaround is to reopen Blazer::BaseController and set the default form builder ActionView::Helpers::FormBuilder. I don't feel good about that. I would prefer to have a Blazer configuration that allows me to set an alternate parent for Blazer::BaseControIller.

Thoughts? If you're into it I'll submit a PR some time.

ankane commented 9 months ago

Hi @dhnaranjo, thanks for the suggestion. This isn't something I'd like to make configurable right now, but pushed a fix for the specific issue with default_form_builder in the commit above.