diff --git a/app/views/documentation/index.html.erb b/app/views/documentation/index.html.erb index 834d7933..c41ef513 100644 --- a/app/views/documentation/index.html.erb +++ b/app/views/documentation/index.html.erb @@ -24,33 +24,50 @@
Example: Lets build the following form.
+ -The code is straightforward and looks like this:
-- Note that the code is very simple, and the only think you have to set is - the wrapper option inside each field. + The code is very simple, isn't it?
But it can get better! We can use the wrapper_mapping
option
- to remove this duplication. Lets see how our code will look like.
+ to remove that wrapper duplication. This option receives a Hash containing an input
+ type and the wrapper that will be used for all inputs with specified type.
+ Example: +
+ { string: :string_wrapper, boolean: :boolean_wrapper }
+
:string_wrapper
, and the
+ same applies to boolean fields, which will use the :boolean_wrapper
+ for all its inputs.
+ You can see more information about wrapper_mappings
+ <%= link_to 'here.', 'https://github.com/plataformatec/simple_form/blob/master/lib/simple_form.rb#L125-L131' %>
+
+Simple, right? You can see the code for the other examples <%= link_to 'on github.', 'https://github.com/rafaelfranca/simple_form-bootstrap' %>