This project is archived and is in readonly mode.

#2142 ✓wontfix
Andrew Chalkley

DRYing up scaffold generator by generating a form partial

Reported by Andrew Chalkley | March 5th, 2009 @ 09:27 PM | in 2.x

Creates form partial when generating a scaffold. I.e. _form.html.erb is added in addition to new.html.erb, edit.html.erb, index.html.erb, and show.html.erb. Form partial included in new and edit.

Modified form helper with sensible defaults i.e.


f.submit #value = "Create" if form's object is new_record? or "Update" if !new_record?

No need to pass in a value into a form. Helper is intelligent enough to do it for you.

Modified test.

See patch.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages