Class: Suspenders::ViewsGenerator

Inherits:
Generators::Base show all
Defined in:
lib/suspenders/generators/views_generator.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

default_source_root, inherited

Methods included from Actions

#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file

Instance Method Details

#create_application_layoutObject


24
25
26
27
28
# File 'lib/suspenders/generators/views_generator.rb', line 24

def create_application_layout
  template "suspenders_layout.html.erb.erb",
    "app/views/layouts/application.html.erb",
    force: true
end

#create_partials_directoryObject


5
6
7
# File 'lib/suspenders/generators/views_generator.rb', line 5

def create_partials_directory
  empty_directory "app/views/application"
end

#create_shared_css_overridesObject


19
20
21
22
# File 'lib/suspenders/generators/views_generator.rb', line 19

def create_shared_css_overrides
  copy_file "_css_overrides.html.erb",
    "app/views/application/_css_overrides.html.erb"
end

#create_shared_flashesObject


9
10
11
12
# File 'lib/suspenders/generators/views_generator.rb', line 9

def create_shared_flashes
  copy_file "_flashes.html.erb", "app/views/application/_flashes.html.erb"
  copy_file "flashes_helper.rb", "app/helpers/flashes_helper.rb"
end

#create_shared_javascriptsObject


14
15
16
17
# File 'lib/suspenders/generators/views_generator.rb', line 14

def create_shared_javascripts
  copy_file "_javascript.html.erb",
    "app/views/application/_javascript.html.erb"
end