레일을 처음 사용하고 컨트롤러를 만들 때 서브 클래스의 "유형"을 설정하려고합니다. 어떻게해야합니까?레일스에서 단일 테이블 상속을 사용하여 컨트롤러에 "type"을 설정하는 방법은 무엇입니까?
def create
@picture = Post.new(params[:picture])
@picture.type = "Picture"
if @picture.save
redirect_to @artist, :notice => "Successfully posted picture."
else
render :action => 'new'
end
end