Created
April 3, 2012 22:07
-
-
Save anonymous/2295834 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
@resetInputsForForm: (form_html, taskNumber, taskType) -> | |
$(form_html).find('input').each (index, element) -> | |
taskNamePrefix = "#{taskType}_task" | |
currentName = $(element).attr('name') | |
multipleParamNamePrefix = "inputs_for_task['#{taskNumber}']" | |
newName = currentName.replace(taskNamePrefix, multipleParamNamePrefix) | |
$(element).attr('name', newName) | |
$(form_html) | |
# pseudo | |
@ajaxMethod: () -> | |
# call resetInputsForForm, append result to a wrapper | |
# div which then gets appended into viewport div in the DOM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment