On 4 November 2011 16:25, JavierQQ <[email protected]> wrote: > I'm doing it :) > but I read in another place, that its not safe.. or not recommended to > access a controller from a model > is that true?
Please don't top post, it makes it difficult to follow the thread. Insert your reply at appropriate points in previous message. Thanks. As I said you do not need to access the controller. It is entirely within the model. The model knows whether it is being asked to create a new record or to update an existing one. Look at section 4.4 in the guide (:on) Colin > > Those def were created when I made rails g scaffold > > On 4 nov, 11:21, Colin Law <[email protected]> wrote: >> On 4 November 2011 16:05, JavierQQ <[email protected]> wrote: >> >> >> >> > I want that it only validates it when I'm CREATING a new one, not when >> > I'm UPDATING >> >> > How can I do that? >> >> That is not really a function of the controller action, it is just >> whether you are creating a record or updating an existing one. Did >> you read the guide as I suggested? >> >> Colin > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- gplus.to/clanlaw -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

