README.md in invisible_captcha-0.7.0 vs README.md in invisible_captcha-0.8.0

- old
+ new

@@ -107,30 +107,20 @@ end ``` ## Options and customization -This section contains the option list of `invisible_captcha` method (controllers side) and the plugin setup options (initializer). +This section contains a description of all plugin options and customizations. -### Controller method options: - -The `invisible_captcha` method accepts some options: - -* `only`: apply to given controller actions. -* `except`: exclude to given controller actions. -* `honeypot`: name of honeypot. -* `scope`: name of scope, ie: 'topic[subtitle]' -> 'topic' is the scope. -* `on_spam`: custom callback to be called on spam detection. - ### Plugin options: -You also can customize some plugin options: +You can customize: * `sentence_for_humans`: text for real users if input field was visible. * `error_message`: error message thrown by model validation (only model implementation). * `honeypots`: collection of default honeypots, used by the view helper, called with no args, to generate the honeypot field name -* `visual_honeypots`: make honeypots visible, useful to test/debug your implementation. +* `visual_honeypots`: make honeypots visible, also useful to test/debug your implementation. To change these defaults, add the following to an initializer (recommended `config/initializers/invisible_captcha.rb`): ```ruby InvisibleCaptcha.setup do |config| @@ -139,10 +129,32 @@ config.honeypots += 'fake_resource_title' config.visual_honeypots = false end ``` +### Controller method options: + +The `invisible_captcha` method accepts some options: + +* `only`: apply to given controller actions. +* `except`: exclude to given controller actions. +* `honeypot`: name of honeypot. +* `scope`: name of scope, ie: 'topic[subtitle]' -> 'topic' is the scope. +* `on_spam`: custom callback to be called on spam detection. + +### View helpers options: + +Using the view/form helper you can override some defaults for the given instance. Actually, it allows to change: `sentence_for_humans` and `visual_honeypots`. + +```erb +<%= form_for(@topic) do |f| %> + <%= f.invisible_captcha :subtitle, visual_honeypots: true, sentence_for_humans: "Ei, don't fill on this input!" %> + <!-- or --> + <%= invisible_captcha visual_honeypots: true, sentence_for_humans: "Ei, don't fill on this input!" %> +<% end %> +``` + ## Contribute Any kind of idea, feedback or bug report are welcome! Open an [issue](https://github.com/markets/invisible_captcha/issues) or send a [pull request](https://github.com/markets/invisible_captcha/pulls). ## Development @@ -161,6 +173,6 @@ $ rake web # PORT=4000 (default: 3000) ``` ## License -Copyright (c) 2012-2014 Marc Anguera. Invisible Captcha is released under the [MIT](LICENSE) License. +Copyright (c) 2012-2015 Marc Anguera. Invisible Captcha is released under the [MIT](LICENSE) License.