Class: TailwindViews::Generators::DeviseGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
TailwindViewsGenerator::Helpers
Defined in:
lib/generators/tailwind_views/devise_generator.rb

Overview

Generator to run to add devise templates to the application

Instance Method Summary collapse

Methods included from TailwindViewsGenerator::Helpers

#app_name

Instance Method Details

#installObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/tailwind_views/devise_generator.rb', line 23

def install
  template "#{file_template_location('confirmations/new')}.tt", "app/views/devise/confirmations/new.html.#{options[:template_engine]}", force: true
  directory "#{options[:template_engine]}/mailer", 'app/views/devise/mailer', force: true

  %i[edit new].map do |file|
    template "#{file_template_location("passwords/#{file}")}.tt", "app/views/devise/passwords/#{file}.html.#{options[:template_engine]}", force: true
    template "#{file_template_location("registrations/#{file}")}.tt", "app/views/devise/registrations/#{file}.html.#{options[:template_engine]}", force: true
  end
  template "#{file_template_location('sessions/new')}.tt", "app/views/devise/sessions/new.html.#{options[:template_engine]}", force: true
  template "#{file_template_location('unlocks/new')}.tt", "app/views/devise/unlocks/new.html.#{options[:template_engine]}", force: true
  directory "#{options[:template_engine]}/shared", 'app/views/devise/shared', force: true
end