Skip to content

Commit

Permalink
This filter might switch the global flag when it was disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed May 9, 2015
1 parent 0e0c837 commit 93892db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -125,9 +125,10 @@ Set `config.enabled = false` in Html5Validators

Controller:
around_action do |controller, block|
h5v_enabled_was = Html5Validators.enabled
Html5Validators.enabled = false if params[:h5v] == 'disable'
block.call
Html5Validators.enabled = true if params[:h5v] == 'disable'
Html5Validators.enabled = h5v_enabled_was
end

## Supported versions
Expand Down

0 comments on commit 93892db

Please sign in to comment.