Form validation on non-CRUD activities

Hi there,

I’m relativity new to Rails (I’ve been eying it for some time,
though). I’m reasonably familiar with Ruby’s syntax.

When I pick up a new language, I like to make a simple blog. I’m
focusing on the authentication at the moment. I am well aware of the
existing plugins out there, but since this application will never see
the light of day and I learning by rolling my own.

Now, let’s say I have a login form, how do I validate that? I’m not
saving into a model, or anything like that. At this stage, I’m just
using a form_tag, and doing simple if params[:username] == ‘’ in the
controller. Very ugly indeed.

What is the best way to validate a form (and get the nice error
messages, like when you are scaffolding) when you are not necessarily
saving data?


Here’s what i use -

Maurício Linhares (pt-br) |