# Bug or feature? rhtml file is not using the overwritten accessor of ActiveRecord class

**URL:** <https://www.ruby-forum.com/t/bug-or-feature-rhtml-file-is-not-using-the-overwritten-accessor-of-activerecord-class/122565>\
**Category:** Rails\
**Created:** [December 9, 2007, 2:52pm UTC](https://www.ruby-forum.com/t/bug-or-feature-rhtml-file-is-not-using-the-overwritten-accessor-of-activerecord-class/122565 "2007-12-09T14:52:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [December 9, 2007, 2:52pm UTC](https://www.ruby-forum.com/t/bug-or-feature-rhtml-file-is-not-using-the-overwritten-accessor-of-activerecord-class/122565/1 "2007-12-09T14:52:24Z")

</div>

Hi,  
I was wondering about a quite strange behaviour in RoR:

I overwrote the default accessors for the “duration” field of my  
ActiveRecord class “Task” to do some conversion.  
In my View in the rhtml file, I tried to use:  
\<%= text\_field ‘task’, ‘duration’ %\>

When writing the duration, it correctly uses my duration= method, but  
when reading the duration for displaying it in the textfield, it  
somehow bypasses my overwritten duration method.

However, when i use the following code, it works for writing _and_  
reading:  
\<%= text\_field\_tag ‘task[duration]’, @blocking.duration %\>

That behaviour seems quite strange to me, does anyone have an  
explanation?  
Thanks,  
Erik.
