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
Mohit Sindhwani wrote:
> 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.
>
>
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
>
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant