# Form helpers and overloaded methods - help!

**URL:** <https://www.ruby-forum.com/t/form-helpers-and-overloaded-methods-help/83194>\
**Category:** Rails\
**Created:** [March 17, 2006, 4:14pm UTC](https://www.ruby-forum.com/t/form-helpers-and-overloaded-methods-help/83194 "2006-03-17T16:14:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [March 17, 2006, 4:14pm UTC](https://www.ruby-forum.com/t/form-helpers-and-overloaded-methods-help/83194/1 "2006-03-17T16:14:26Z")

</div>

Brian,

I have the same problem. I don’t have an answer for you but I think the  
more  
appropriate place to modify the code is at (line after !!! comment):

def to\_input\_field\_tag(field\_type, options = {})  
options = options.stringify\_keys  
options[“size”] ||= options[“maxlength”] ||  
DEFAULT\_FIELD\_OPTIONS[“size”]  
options = DEFAULT\_FIELD\_OPTIONS.merge(options)  
if field\_type == “hidden”  
options.delete(“size”)  
end  
options[“type”] = field\_type

# !!! options[“value”] ||= value\_before\_type\_cast unless field\_type ==

“file”  
options[“value”] ||= value unless field\_type == “file”  
add\_default\_name\_and\_id(options)  
tag(“input”, options)  
end

I have a suspicion that value\_before\_type\_cast was used for things that  
don’t  
degrade well to a string after type casting.

What is interesting is it appears that the typical form processing is  
not  
symmetrical, when I instantiate an object using the form parameters when  
processing the submit, it does go through the overridden methods.

For now, I have made the above change in my development environment and  
am  
continuing to test with it.

Eric
