STI and Active Record

Hey,

I’m trying to use STI in my models, while writing a little cms.
A have a model called Page and some subclasses like ContentPage,
Sysfolder etc. Some classes share similar attributes, so I use STI and
one table for all types.
Now I’m writing a form for edititing a page and I want to have the
opportunity to change the type of it at runtime. But that seems to be
a problem:

When I say:

page = Page.find(x)
page.type = ContentPage

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs