Currently i am creating a form that changes its content dynamically on switching a select box. To keep my code clean I am creating 3 different partials. As I want to be DRY, I keep the form statement in the main ERB file. To get this to work you just need to pass in the local variable f of the form.

<%= form_for(@model) do |f| %> <div id="_mcePaste"><p></div> <div id="_mcePaste"><%= f.text_field :name %> Please enter a descriptive name</div> <div id="_mcePaste"></p></div> <div id="_mcePaste"><p></div> <div id="_mcePaste"><%= render :partial => ‘form’, :locals => {:f => f} %></div> <div id="_mcePaste"><div></div> <div id="_mcePaste"><%= f.submit ‘continue’ %></div> <div id="_mcePaste"></div></div> <div id="_mcePaste"><% end %></div>