<%= form_with model: [:admin, @book] do |f| %>
<div class="form-group">
  <label for="title">Title</label>
  <%= f.text_field :title, class: 'form-control', id: 'title' %>
</div>
<div class="form-group">
  <label for="author">Author</label>
  <%= f.text_field :author, class: 'form-control', id: 'author' %>
</div>
<div class="form-group">
  <label for="genre">Genre</label>
  <%= f.select :genre, Book.genres.keys.map {|genre| [genre.titleize,genre]},{}, class: 'form-control', id: 'genre' %>
</div>
<div class="form-group">
  <label for="sub_genre">Sub Genre</label>
  <%= f.select :sub_genre, Book.sub_genres.keys.map {|sub_genre| [sub_genre.titleize,sub_genre]},{}, class: 'form-control', id: 'sub_genre' %>
</div>
<div class="form-group">
  <label for="pages">Pages</label>
  <%= f.number_field :pages, class: 'form-control', id: 'pages' %>
</div>
<div class="form-group">
  <label for="copies">Copies</label>
  <%= f.number_field :copies, class: 'form-control', id: 'copies' %>
</div>

<div class="form-group">
  <%= f.submit 'Save', class: 'btn btn-primary'%>
</div>

<% end %>