Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Change the way 'perform_browser_validations' option is used. #644

Merged
merged 1 commit into from

3 participants

@Juanmcuello

'novalidate' attribute should be added when this option is set to 'false'
instead of 'true'.

Related to #626.

@Juanmcuello Juanmcuello Change the way 'perform_browser_validations' option is used.
'novalidate' attribute should be added when this option is set to 'false'
instead of 'true'.

Related to #626.
2bcedcf
@sobrinho sobrinho merged commit 29c45b9 into from
@sobrinho
Collaborator

Pulled, thans!

@justinfrench
Owner

Man, that's embarrassing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 5, 2011
  1. @Juanmcuello

    Change the way 'perform_browser_validations' option is used.

    Juanmcuello authored
    'novalidate' attribute should be added when this option is set to 'false'
    instead of 'true'.
    
    Related to #626.
This page is out of date. Refresh to see the latest.
View
2  lib/formtastic/helpers/form_helper.rb
@@ -143,7 +143,7 @@ def semantic_form_for(record_or_name_or_array, *args, &proc)
options = args.extract_options!
options[:builder] ||= @@builder
options[:html] ||= {}
- options[:html][:novalidate] = builder.perform_browser_validations unless options[:html].key?(:novalidate)
+ options[:html][:novalidate] = !builder.perform_browser_validations unless options[:html].key?(:novalidate)
@@builder.custom_namespace = options[:namespace].to_s
singularizer = defined?(ActiveModel::Naming.singular) ? ActiveModel::Naming.method(:singular) : ActionController::RecordIdentifier.method(:singular_class_name)
View
4 spec/helpers/form_helper_spec.rb
@@ -28,7 +28,7 @@
with_config :perform_browser_validations, true do
concat(semantic_form_for(@new_post, :url => '/hello') do |builder|
end)
- output_buffer.should have_tag("form[@novalidate]")
+ output_buffer.should_not have_tag("form[@novalidate]")
end
end
@@ -36,7 +36,7 @@
with_config :perform_browser_validations, false do
concat(semantic_form_for(@new_post, :url => '/hello') do |builder|
end)
- output_buffer.should_not have_tag("form[@novalidate]")
+ output_buffer.should have_tag("form[@novalidate]")
end
end
Something went wrong with that request. Please try again.