Created
November 7, 2008 10:55
-
-
Save jeroenvandijk/22823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fields_for_work_experience(work_experience, &block) | |
prefix = work_experience.new_record? ? 'new' : 'existing' | |
# uses the fields_for helper with a block that gives an extra option to the form fields preventing hash and array param clashes (also for date_selects) which | |
# would otherwise cause a server error. | |
fields_for("candidate[#{prefix}_work_experience_attributes][]", work_experience) { |wef| wef.with_options :index => "", &block } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment