Browse Source

Add devise bootstrapped and bootstrap's tether

Chris Oliver 7 years ago
parent
commit
02b100a6fc
1 changed files with 16 additions and 11 deletions
  1. 16 11
      template.rb

+ 16 - 11
template.rb

@@ -4,8 +4,10 @@ end
 
 def add_gems
   gem 'devise', github: 'plataformatec/devise' #, '~> 4.2.1'
+  gem 'devise-bootstrapped', github: 'king601/devise-bootstrapped', branch: 'bootstrap4'
   gem 'jquery-rails', '~> 4.3.1'
   gem 'bootstrap', '~> 4.0.0.alpha6'
+  gem 'rails-assets-tether', '>= 1.3.3', source: 'https://rails-assets.org'
   gem 'webpacker', '~> 1.1'
   gem 'sidekiq', '~> 5.0'
   gem 'foreman', '~> 0.84.0'
@@ -38,13 +40,15 @@ def add_users
 end
 
 def add_bootstrap
+  generate "devise:views:bootstrapped"
+
   # Remove Application CSS
   run "rm app/assets/stylesheets/application.css"
 
   # Add Bootstrap JS
   insert_into_file(
     "app/assets/javascripts/application.js",
-    "\n//= require jquery\n//= require bootstrap",
+    "\n//= require jquery\n//= require tether\n//= require bootstrap",
     after: "//= require rails-ujs"
   )
 end
@@ -75,18 +79,19 @@ end
 
 # Main setup
 add_gems
-add_users
-add_bootstrap
-copy_templates
-add_sidekiq
-add_foreman
-add_webpack
-
-# Migrate
-rails_command "db:create"
-rails_command "db:migrate"
 
 after_bundle do
+  add_users
+  add_bootstrap
+  copy_templates
+  add_sidekiq
+  add_foreman
+  add_webpack
+
+  # Migrate
+  rails_command "db:create"
+  rails_command "db:migrate"
+
   git :init
   git add: "."
   git commit: %Q{ -m 'Initial commit' }