Class: Frontsite::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_routesObject



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/generators/frontsite/install_generator.rb', line 41

def add_routes
  route "root to: 'site#index'"
  route "get 'home', to: 'site#index'"
  route "get 'about', to: 'site#about'"
  route "get 'products', to: 'site#products'"
  route "get 'pricing', to: 'site#pricing'"
  route "get 'contact', to: 'site#contact'"
  route "get 'feed', to: 'site#feed'"
  route "get 'privacy_policy', to: 'site#privacy_policy'"
  route "get 'terms', to: 'site#terms'"
  route "get 'faqs', to: 'site#faqs'"
end

#copy_controllerObject



8
9
10
# File 'lib/generators/frontsite/install_generator.rb', line 8

def copy_controller
  copy_file "site_controller.rb", "app/controllers/site_controller.rb"
end

#copy_helperObject



12
13
14
# File 'lib/generators/frontsite/install_generator.rb', line 12

def copy_helper
  copy_file "site_helper.rb", "app/helpers/site_helper.rb"
end

#copy_layoutObject



16
17
18
# File 'lib/generators/frontsite/install_generator.rb', line 16

def copy_layout
  copy_file "site.html.erb", "app/views/layouts/site.html.erb"
end

#copy_partialsObject



20
21
22
23
# File 'lib/generators/frontsite/install_generator.rb', line 20

def copy_partials
  copy_file "_site_navigation.html.erb", "app/views/shared/_site_navigation.html.erb"
  copy_file "_site_footer.html.erb", "app/views/shared/_site_footer.html.erb"
end

#copy_stylesObject



37
38
39
# File 'lib/generators/frontsite/install_generator.rb', line 37

def copy_styles
  copy_file "site.scss", "app/stylesheets/site.scss"
end

#copy_viewsObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/generators/frontsite/install_generator.rb', line 25

def copy_views
  copy_file "index.html.erb", "app/views/site/index.html.erb"
  copy_file "about.html.erb", "app/views/site/about.html.erb"
  copy_file "products.html.erb", "app/views/site/products.html.erb"
  copy_file "pricing.html.erb", "app/views/site/pricing.html.erb"
  copy_file "contact.html.erb", "app/views/site/contact.html.erb"
  copy_file "feed.html.erb", "app/views/site/feed.html.erb"
  copy_file "privacy_policy.html.erb", "app/views/site/privacy_policy.html.erb"
  copy_file "terms.html.erb", "app/views/site/terms.html.erb"
  copy_file "faqs.html.erb", "app/views/site/faqs.html.erb"
end