STIの使用では、特定の:タイプのすべてのページを取得しようとしています。私はその下pages_controller.rb class PagesController < ApplicationController
def index
@pages = Page.all
end
end
でメインクラスを持っている 、私はpages_controller.rb
クラスの単一表継承先生、生徒、外部者のタイプにできる人。 class Person < ActiveRecord::Base
end
class Teacher < Person
end
class Student < Person
end
class Outsider < Person
end
新しいユーザーを登録するときに、ルートとフォームにどのような変更を加
私は人のクラス class Person < ActiveRecord::Base
end
class Teacher < Person
end
class Student < Person
end
class Outsider < Person
end
のための単一テーブル継承を実装していると作成者は、フォームで選択されている内容に応じて教師、学生や人を作成し動