Class: Integral::Generators::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/integral/views_generator.rb

Overview

Generates a copy of Integral views

Examples:

Generate all Integral views

rails g integral:views --views 'backend frontend devise mailer'

Instance Method Summary collapse

Instance Method Details

#copy_backend_viewsObject

Copies over backend views



14
15
16
17
18
19
20
# File 'lib/generators/integral/views_generator.rb', line 14

def copy_backend_views
  return unless options['views'].include?('backend')

  directory 'integral/backend'
  directory 'layouts/integral/backend'
  file 'layouts/integral/backend.html.haml'
end

#copy_devise_viewsObject

Copies over devise views



44
45
46
47
48
49
# File 'lib/generators/integral/views_generator.rb', line 44

def copy_devise_views
  return unless options['views'].include?('devise')

  directory 'devise'
  file 'layouts/integral/login.haml'
end

#copy_frontend_viewsObject

Copies over frontend views



23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/integral/views_generator.rb', line 23

def copy_frontend_views
  return unless options['views'].include?('frontend')

  directory 'integral/pages'
  directory 'integral/posts'
  directory 'integral/tags'
  directory 'integral/shared'
  directory 'layouts/integral/frontend'
  file 'layouts/integral/frontend.html.haml'
end

#copy_mailer_viewsObject

Copies over mailer views



35
36
37
38
39
40
41
# File 'lib/generators/integral/views_generator.rb', line 35

def copy_mailer_views
  return unless options['views'].include?('mailer')

  directory 'integral/contact_mailer'
  directory 'layouts/integral/mailer'
  file 'layouts/integral/mailer.html.inky-haml'
end