With ref to my previous post: RESTful app and refactoring code in different controllers - Rails - Ruby-Forum
I am now able to access items from topics controller. However, now I
need to add sub-item e.g.: An item itself could have many sub-items. So
my items model is like:
class Item < ActiveRecord::Base
validates_uniqueness_of :title, :scope => [:topic_id]
validates_presence_of :topic_id, :title, :owner, :position
I think I mean to say self-referential rather than polymorphism…
Sorry…
CS.
Carlos S. wrote:
With ref to my previous post: RESTful app and refactoring code in different controllers - Rails - Ruby-Forum
I am now able to access items from topics controller. However, now I
need to add sub-item e.g.: An item itself could have many sub-items. So
my items model is like:
class Item < ActiveRecord::Base
validates_uniqueness_of :title, :scope => [:topic_id]
validates_presence_of :topic_id, :title, :owner, :position