Multiple Forms on the Same Page with Rails
Posted
by Eric Koslow
on Stack Overflow
See other posts from Stack Overflow
or by Eric Koslow
Published on 2010-03-20T03:16:26Z
Indexed on
2010/03/20
3:21 UTC
Read the original article
Hit count: 333
So I'm building a rails app for high school students and I've hit a problem when it comes to creating users.
I want the students to only be able to create accounts if they select their school and type in their school's password correctly.
What is the correct / easiest way of doing this? Should I create a gatekeeper to the user#new action that they have to pass first or if their a way that on the same page a student can submit to forms. One would be the regular username, email, password using:
form_for @user do
...
end
But then creating another form for the high-school / high-school password selection.
Ideally the controller would be able to get the params of the high-school form, validate those, then go on to create the user from the user params.
Is this possible using rails?
My setup: Rails 3 and Ruby 1.9.2dev
Thank you!
© Stack Overflow or respective owner