I have a webapplication in Rails 3, where i want users to be able to sign up on the frontpage. The frontpage is controlled by a PagesController and the sign up process is controlled RegistrationController (I use Devise). I have no problem by adding the sign up form on the frontpage, and everything works when you submit the form correctly. I have just render the form as a partial:
<%= render "/users/registrations/form" %>
And in the form i have
<%= simple_form_for(@user, :url => registration_path(@user)) do |f| %>
However if a user try to submit with errors (eg. missing information), will the user be redirected to the standard sign up page. The errors is displayed fine, but i want the user to stay on the frontpage, with the error messages shown there.
So first of all i need to render the frontpage again, when the sign up process fails, and i want error messages to be shown, but i still want the standard sign up page to work like normally. How can i do this the best way, and still keep it DRY?
Hope you can help me