diff --git a/Gemfile b/Gemfile index 078d67e..f058bfe 100644 --- a/Gemfile +++ b/Gemfile @@ -47,6 +47,8 @@ group :production, :test do gem 'pg' end +gem "bootstrap_form" + gem 'devise' # Windows does not include zoneinfo files, so bundle the tzinfo-data gem diff --git a/Gemfile.lock b/Gemfile.lock index 5c00004..35a24db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,6 +62,9 @@ GEM bindex (0.8.1) bootsnap (1.4.6) msgpack (~> 1.0) + bootstrap_form (4.5.0) + actionpack (>= 5.2) + activemodel (>= 5.2) builder (3.2.4) byebug (11.1.3) capybara (3.32.2) @@ -213,6 +216,7 @@ PLATFORMS DEPENDENCIES bootsnap (>= 1.4.2) + bootstrap_form byebug capybara (>= 2.15) devise diff --git a/app/javascript/packs/stylesheets.scss b/app/javascript/packs/stylesheets.scss new file mode 100644 index 0000000..f13ef28 --- /dev/null +++ b/app/javascript/packs/stylesheets.scss @@ -0,0 +1 @@ +@import 'rails_bootstrap_forms' diff --git a/app/views/categories/_form.html.erb b/app/views/categories/_form.html.erb index fb7c4a4..65eca58 100644 --- a/app/views/categories/_form.html.erb +++ b/app/views/categories/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_with(model: category, local: true) do |form| %> +<%= bootstrap_form_with(model: category, local: true) do |form| %> <% if category.errors.any? %>

<%= pluralize(category.errors.count, "error") %> prohibited this category from being saved:

@@ -12,7 +12,6 @@ <% end %>
- <%= form.label :name %> <%= form.text_field :name %>
diff --git a/app/views/items/_form.html.erb b/app/views/items/_form.html.erb index b835a35..acfd9cc 100644 --- a/app/views/items/_form.html.erb +++ b/app/views/items/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_with(model: item, local: true) do |form| %> +<%= bootstrap_form_with(model: item, local: true) do |form| %> <% if item.errors.any? %>

<%= pluralize(item.errors.count, "error") %> prohibited this item from being saved:

@@ -12,22 +12,18 @@ <% end %>
- <%= form.label :name %> <%= form.text_field :name %>
- <%= form.label :category_id %> <%= form.text_field :category_id %>
- <%= form.label :serial_number %> <%= form.text_field :serial_number %>
- <%= form.label :available %> <%= form.check_box :available %>
diff --git a/app/views/loans/_form.html.erb b/app/views/loans/_form.html.erb index 9174fdf..675c594 100644 --- a/app/views/loans/_form.html.erb +++ b/app/views/loans/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_with(model: loan, local: true) do |form| %> +<%= bootstrap_form_with(model: loan, local: true) do |form| %> <% if loan.errors.any? %>

<%= pluralize(loan.errors.count, "error") %> prohibited this loan from being saved:

@@ -12,32 +12,26 @@ <% end %>
- <%= form.label :user_id %> <%= form.text_field :user_id %>
- <%= form.label :item_id %> <%= form.text_field :item_id %>
- <%= form.label :requested_at %> <%= form.datetime_select :requested_at %>
- <%= form.label :fulfilled_at %> <%= form.datetime_select :fulfilled_at %>
- <%= form.label :returned_at %> <%= form.datetime_select :returned_at %>
- <%= form.label :status %> <%= form.number_field :status %>
diff --git a/config/webpacker.yml b/config/webpacker.yml index 8581ac0..3f5b076 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -17,7 +17,7 @@ default: &default cache_manifest: false # Extract and emit a css file - extract_css: false + extract_css: true static_assets_extensions: - .jpg