# Error in scaffolding Page

**URL:** <https://www.ruby-forum.com/t/error-in-scaffolding-page/119048>\
**Category:** Radiant CMS\
**Created:** [November 2, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/error-in-scaffolding-page/119048 "2007-11-02T15:56:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [November 2, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/error-in-scaffolding-page/119048/1 "2007-11-02T15:56:36Z")

</div>

Hi, I was thinking of finding a quick & dirty way to update the  
published\_at date for the articles on my website. I’m migrating from a  
static page site (not Mephisto, etc.), so I thought it might just be  
better to iterate through the articles and update the published\_at date  
directly.

For this, I followed the LinkRoll tutorial on the wiki and created an  
extension. Then, instead of being bothered with anything else, I  
created a tab in the admin and asked it to scaffold the Page instead.

This works fine - it paginates and lists the pages from the database.  
It also lets me click on any page to edit it and shows me the defaults.

However, when I change any thing and click on update, it shows an  
exception as below:

ActiveRecord::AssociationTypeMismatch in  
Admin/propertiesController#update

User expected, got String  
RAILS\_ROOT: ./script/…/config/…

Any idea what I can look at? Or, is this a lost cause and something I  
_should_ not do at all?

Thanks,  
Mohit.  
11/2/2007 | 10:55 PM.

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [November 2, 2007, 4:13pm UTC](https://www.ruby-forum.com/t/error-in-scaffolding-page/119048/2 "2007-11-02T16:13:35Z")

</div>

Mohit,

It might be easier to add a datetime selector to the page edit screen.  
I would do it like this:

Admin::PageController.class\_eval do  
before\_filter :add\_published\_at\_meta

def add\_published\_at\_meta  
@meta ||=[]  
@meta \<\< {:field =\> “published\_at”, :type =\> “datetime\_select”}  
end  
end

Cheers,

Sean

---

<div class="post-metadata">

**Author:** ![mohits](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mohits](https://www.ruby-forum.com/u/mohits)\
**Post date:** [November 2, 2007, 4:18pm UTC](https://www.ruby-forum.com/t/error-in-scaffolding-page/119048/3 "2007-11-02T16:18:51Z")

</div>

Hi Sean,

Thanks for the quick reply. I was just looking at whether I should add  
that using some of the techniques in the PageAttachment extension. This  
certainly look simpler, but I’m sorry I don’t know where this should go.

Sorry for the trouble :-S

Cheers,  
Mohit.  
11/2/2007 | 11:17 PM.
