Created
May 12, 2015 15:21
-
-
Save raarellano/e30378ad38b5668475e0 to your computer and use it in GitHub Desktop.
Fields inside a fields_for block
This file contains 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 sanitized_object_name(object_name) | |
object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "") | |
end | |
def sanitized_method_name(method_name) | |
method_name ||= @method_name.sub(/\?$/,"") | |
end | |
def form_tag_id(object_name, method_name) | |
"#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment