eweitnauer-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2007-Dec-09 13:51 UTC
Bug or feature? rhtml file is not using the overwritten accessor of ActiveRecord class
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---