Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

DRYing up scaffold generator by generating a form partial

#2142

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.

Reported by Andrew Chalkley · March 5th, 2009 @ 09:27 PM

State: wontfix
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to wontfix

    March 6th, 2009 @ 04:15 PM