# ActiveResource and dates

**URL:** <https://www.ruby-forum.com/t/activeresource-and-dates/104111>\
**Category:** Rails\
**Created:** [May 14, 2007, 1:12pm UTC](https://www.ruby-forum.com/t/activeresource-and-dates/104111 "2007-05-14T13:12:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [May 14, 2007, 1:12pm UTC](https://www.ruby-forum.com/t/activeresource-and-dates/104111/1 "2007-05-14T13:12:55Z")

</div>

Hi  
I’m having difficulty using form date\_select on a date attribute when  
using ActiveResource.

The xml attribute looks like:

yyyy-mm-dd

And the form is simple form\_for scaffolding:

form\_for :model do |f|

f.date\_select :date

end

When I run this I get the following error:

undefined method `day’ for “2006-05-09”:String

I think I have to do something with the attribute type but I’m unsure  
exactly what and where.

Thx

Jason

---

<div class="post-metadata">

**Author:** ![jason](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@jason](https://www.ruby-forum.com/u/jason)\
**Post date:** [May 14, 2007, 1:58pm UTC](https://www.ruby-forum.com/t/activeresource-and-dates/104111/2 "2007-05-14T13:58:59Z")

</div>

Solution

@model.date = Date.parse(@model.date)

in the client controller.
