Friday, November 4, 2011

[Rails] Re: Validate in a model using a controller def

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?

Those def were created when I made rails g scaffold

On 4 nov, 11:21, Colin Law <clan...@googlemail.com> wrote:
> On 4 November 2011 16:05, JavierQQ <jquari...@gmail.com> 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate