Skip to content

Commit

Permalink
Fixed issue #526
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Dean Watson-Hamblin committed Apr 14, 2013
1 parent 0bd8451 commit 1602e5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/client_side_validations/action_view/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def build_validation_options(method, options = {})
if @options[:validate]
index = @default_options[:index].present? ? "[#{@default_options[:index]}]" : ''
name = options[:name] || "#{@object_name}#{index}[#{method}]"
child_index = @options[:child_index] ? "(\\d+|#{Regexp.escape(@options[:child_index])})" : "\\d+"
child_index = @options[:child_index] ? "(\\d+|#{Regexp.escape(@options[:child_index].to_s)})" : "\\d+"
name = name.to_s.gsub(/_attributes\]\[#{child_index}\]/, '_attributes][]')
name = "#{name}#{options[:multiple] ? "[]" : nil}"
@options[:validators][@object][method] = { :name => name, :options => options[:validate] }
Expand Down

0 comments on commit 1602e5d

Please sign in to comment.