Has anyone come up with a solution for stubbing partials and passing form builders to it? i have a complex form with many parts, and those are rendered in partials
On Oct 21, 2007, at 8:46 AM, rupert wrote: >> i'm having problem with a form_for situation where i'm trying to DRY >> out the repeated parts of my forms and put them in common/form and >> render the form elements via another partial in controller_name/ >> _form. >> Here's the first form >> >> # app/views/common/form >> <% form_for ... do |f| -%> >> <%= render :partial => "params[:controller]/form", :object => f %> >> <p>Submit buttons...</p> >> <% end -%> > > I had exactly the same problem and ending up putting the > > form_for ...do |f| > > in the partial so I didn't have to pass form builders around. This > won't be practical though if you are using multiple partials for your > forms fields. > > Rupert > > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users