Re: [Rails] Auto generate models on creation of other models in Ruby on Rails

2013-05-10 Thread Colin Law
On 10 May 2013 11:36, Carlos Mathiasen wrote: > On Fri, May 10, 2013 at 5:09 AM, Colin Law wrote: >> >> On 9 May 2013 22:41, Jessica Lu wrote: >> > I have a model called Video that has many statuses. I want to create a >> > status of each kind and add it to @video.statuses in the def create of >

Re: [Rails] Auto generate models on creation of other models in Ruby on Rails

2013-05-10 Thread Carlos Mathiasen
On Fri, May 10, 2013 at 5:09 AM, Colin Law wrote: > On 9 May 2013 22:41, Jessica Lu wrote: > > I have a model called Video that has many statuses. I want to create a > > status of each kind and add it to @video.statuses in the def create of > > VideosController. > > > > In VideosController, I ha

Re: [Rails] Auto generate models on creation of other models in Ruby on Rails

2013-05-10 Thread Colin Law
On 9 May 2013 22:41, Jessica Lu wrote: > I have a model called Video that has many statuses. I want to create a > status of each kind and add it to @video.statuses in the def create of > VideosController. > > In VideosController, I have: > > def create > @video = Video.new(params[:video]) >

[Rails] Auto generate models on creation of other models in Ruby on Rails

2013-05-10 Thread Jessica Lu
I have a model called Video that has many statuses. I want to create a status of each kind and add it to @video.statuses in the def create of VideosController. In VideosController, I have: def create @video = Video.new(params[:video]) Kind.all.each do |f| @video.statuses.new(:k