Error in scaffolding Page

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

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

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?

11/2/2007 | 10:55 PM.


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”}



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

11/2/2007 | 11:17 PM.