Limitations of LabeledFormBuilder
14 Nov 2009, 16:50
Nick Berveiler (2 posts)
I have discovered that when I overwrite the text_field method, there is no way to use the parent text_field method within another method. If there is a way to get at the parent text_field, please correct me. One alternate solution is to rename all custom form methods to have names that are different from the parent class, but it would have been very time consuming to go back into all my other forms to make that change and I don’t like having to add that additional complexity to every method name.
My goal was to create a custom auto complete text field (see railscast #102) within my form builder, but instead I just created a helper function that is called outside of the custom form builder. I don’t like that I have a separation of my form code within a helper file as well as within my custom form class, but other problems within the custom form class include the fact that I cannot create model objects inside of my form class either. (I don’t like calling models from the view, however to obtain select list options, I am willing to make that exception)
Thanks for all of your work creating this series, I hope to see new episodes soon!
|You must be logged in to comment|