alamodey
alamodey

Reputation: 14938

Making forms in Rails

So far I've built a simple form for a user using the form_for method to wrap around my user model.

But if I'm going to create a form now which doesn't doesn't map directly to any particular model, should I still be using form_for?

Upvotes: 1

Views: 129

Answers (2)

jonnii
jonnii

Reputation: 28312

There are a few plugins which allow you to create an active record like model without having to have a database behind it. I would point you to a plugin that gives you this functionality, but I'm not sure which ones are still compatible with Rails 2.x.

If you were to go this route you could create a view mode, use form_for as you would normally and get all the validation stuff thrown in.

I've used this to great effect for things like login forms and the like.

Upvotes: 0

Sophie Alpert
Sophie Alpert

Reputation: 143114

You probably just want form_tag.

Upvotes: 1

Related Questions