Ruby on Rails Tuesday, November 30, 2010

Please quote when replying.

Kai Schlamp wrote in post #965115:
> Thanks for the answers.
> One last general question. Where do you validate your parameters
> fetched by "params" that should be passed to models? Do you check them
> right away in the controller and give them cleaned up to the model, or
> do you just provide them as they are (maybe just put them in single
> variables) and let the model check them?

It's usually the model's job to validate. That's what the validates_*
methods are for.

Validation in the controller will lead to repetitive code scattered all
over the application.

Marnen Laibow-Koser

Posted via

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
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment