<commit_before><% content_for :breadcrumb do %>
  <li><%= link_to "Home", root_path %></li>
  <li class="active">Documentation</li>
<% end %>

<div class='row'>
  <h3>How to build your Rails application with Simple Form and Bootstrap</h3>
</div>

<div class='row'>
  <h4>Configuring your Rails app with Simple Form and Bootstrap</h4>
  <ol>
    <li>Create your new Rails application: <code>rails new my_new_app</code></li>
    <li>Open the generated Gemfile and add the Simple Form dependency: <code>gem 'simple_form'</code></li>
    <li>Install the dependencies: <code>bundle install</code></li>
    <li>Install the Simple Form, using the --bootstrap option: <code>rails generate simple_form:install --bootstrap</code></li>
    <li>Now you have a new Rails application using Simple Form and configured to use Bootstrap</li>
  </ol>
</div>

<div class='row'>
  <h4>Building your first form</h4>

  <p>
    Example: Lets build the following form.
  </p>
</div>

<div class='row'>
  <%= render partial: 'examples/basic_example_sf', layout: 'examples/sf_label', locals: { title: 'Basic Form' } %>
</div>

<div class='row'>
  <p>
    The code is straightforward and looks like this:
  </p>

  <pre>
    <code data-language='ruby'>
      <%= render_code('app/views/documentation/form_example.html.erb') %>
    </code>
  </pre>
</div>

<div class='row'>
  <p>
    The code is very simple, isn't it?
  </p>

  <p>
    But it can get better! We can use the <code>wrapper_mapping</code> option
    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.
  </p>

  <p>
    Example:
    <pre>
      <code data-language='ruby'>{ string: :string_wrapper, boolean: :boolean_wrapper }</code>
    </pre>

    All the String inputs will now use the <code>:string_wrapper</code>, and the
    same applies to boolean fields, which will use the <code>:boolean_wrapper</code>
    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' %>
  </p>
</div>

<div class="row">
  <pre>
    <code data-language='ruby'>
      <%= render_code('app/views/documentation/form_example_with_wrapper_mappings.html.erb') %>
    </code>
  </pre>
</div>

<div class="row">
  <p>
    Simple, right? You can see the code for the other examples
    <%= link_to 'on github.', 'https://github.com/rafaelfranca/simple_form-bootstrap' %>
  </p>
</div><commit_msg>Point to Simple Form version 3.0.2 the link to the Simple Form code.<commit_after><% content_for :breadcrumb do %>
  <li><%= link_to "Home", root_path %></li>
  <li class="active">Documentation</li>
<% end %>

<div class='row'>
  <h3>How to build your Rails application with Simple Form and Bootstrap</h3>
</div>

<div class='row'>
  <h4>Configuring your Rails app with Simple Form and Bootstrap</h4>
  <ol>
    <li>Create your new Rails application: <code>rails new my_new_app</code></li>
    <li>Open the generated Gemfile and add the Simple Form dependency: <code>gem 'simple_form'</code></li>
    <li>Install the dependencies: <code>bundle install</code></li>
    <li>Install the Simple Form, using the --bootstrap option: <code>rails generate simple_form:install --bootstrap</code></li>
    <li>Now you have a new Rails application using Simple Form and configured to use Bootstrap</li>
  </ol>
</div>

<div class='row'>
  <h4>Building your first form</h4>

  <p>
    Example: Lets build the following form.
  </p>
</div>

<div class='row'>
  <%= render partial: 'examples/basic_example_sf', layout: 'examples/sf_label', locals: { title: 'Basic Form' } %>
</div>

<div class='row'>
  <p>
    The code is straightforward and looks like this:
  </p>

  <pre>
    <code data-language='ruby'>
      <%= render_code('app/views/documentation/form_example.html.erb') %>
    </code>
  </pre>
</div>

<div class='row'>
  <p>
    The code is very simple, isn't it?
  </p>

  <p>
    But it can get better! We can use the <code>wrapper_mapping</code> option
    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.
  </p>

  <p>
    Example:
    <pre>
      <code data-language='ruby'>{ string: :string_wrapper, boolean: :boolean_wrapper }</code>
    </pre>

    All the String inputs will now use the <code>:string_wrapper</code>, and the
    same applies to boolean fields, which will use the <code>:boolean_wrapper</code>
    for all its inputs.
    You can see more information about wrapper_mappings
    <%= link_to 'here.', 'https://github.com/plataformatec/simple_form/blob/v3.0.2/lib/simple_form.rb#L107-L111' %>
  </p>
</div>

<div class="row">
  <pre>
    <code data-language='ruby'>
      <%= render_code('app/views/documentation/form_example_with_wrapper_mappings.html.erb') %>
    </code>
  </pre>
</div>

<div class="row">
  <p>
    Simple, right? You can see the code for the other examples
    <%= link_to 'on GitHub.', 'https://github.com/rafaelfranca/simple_form-bootstrap' %>
  </p>
</div>
{'fraction_non_alphanumeric': 0.1464499903269491, 'fraction_numerical': 0.005803830528148578, 'mean_word_length': 3.7171532846715327, 'pattern_counts': {'":': 0, '<': 171, '<?xml version=': 0, '>': 171, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6423690', 'n_tokens_mistral': 1772, 'n_tokens_neox': 1684, 'n_words': 543}