I have a form that displays differently depending on the parameter it was called with.
Ex.
testsite.local/users/new?type=client
So
There are two ways to do it.
Either add a hidden field or an extra parameter to the form_for
Adding hidden field in your form containing named type and set it equal to params[:type] this will preserve the type on the render if validation fails.
View code:
<% form_for @user do |f| %>
...
<%= hidden_field_tag :type, params[:type] %>
<%end%>
Adding an extra paramater to the form:
<% form_for @user, create_user_path(@user, :type => params[:type]) %>
...
<%end%>
Either one will do what you want it to.