Class: Layout::Generators::DeviseGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/layout/devise/devise_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_devise_stylesheetObject

Add stylesheet for Devise views



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/layout/devise/devise_generator.rb', line 12

def add_devise_stylesheet
  dir = File.expand_path("../templates", __FILE__)
  case framework_name
    when 'none'
      # TODO
    when 'simple'
      # TODO
    when 'bootstrap2'
      # TODO
    when 'bootstrap3'
      append_file 'app/assets/stylesheets/framework_and_overrides.css.scss', File.read("#{dir}/bootstrap3.css.scss")
    when 'foundation4'
      # TODO
    when 'foundation5'
      append_file 'app/assets/stylesheets/framework_and_overrides.css.scss', File.read("#{dir}/foundation5.css.scss")
  end
end

#add_devise_viewsObject

Add Devise views



31
32
33
34
35
36
# File 'lib/generators/layout/devise/devise_generator.rb', line 31

def add_devise_views
  copy_file 'sessions/new.html.erb', 'app/views/devise/sessions/new.html.erb'
  copy_file 'passwords/new.html.erb', 'app/views/devise/passwords/new.html.erb'
  copy_file 'registrations/new.html.erb', 'app/views/devise/registrations/new.html.erb'
  copy_file 'registrations/edit.html.erb', 'app/views/devise/registrations/edit.html.erb'
end