- Add it to your Gemfile:
gem 'simple_form'
- Install the gem.
bundle install
- Generate the Simple Form initializer file by running the following command:
rails generate simple_form:install
By default, Simple Form uses the Bootstrap CSS classes for styling. To disable this, add the following line:
# config/initializers/simple_form.rb
config.default_form_class = ''
<%= f.association :book_format, label: false, input_html: { data: { controller: 'book-format-select' } } %>