Results 1 to 4 of 4
Jun 30, 2006, 05:11 #1
- Join Date
- May 2001
- 0 Post(s)
- 0 Thread(s)
Should I do this in the controller or model?
I have an Article class that has a belongs_to relationship with an Author class.
My article form has a list of existing authors to choose from which if one is selected will insert the author_id for the article. It also has the option to create a new author. Where should I put the code to create the author? I currently have it in the ArticleController, where I check for the existance of a variable and if it exists I create a new Author and push the author id to the params for creating the Article.
It doesnt feel right, seems like the Article model should do the work in it's constuctor.
Any ideas or suggestions would be great, thanks.