Class: Bootstrap::Generators::PartialGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/bootstrap/partial/partial_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



11
12
13
# File 'lib/generators/bootstrap/partial/partial_generator.rb', line 11

def app_name
  @app_name
end

Instance Method Details

#generate_partialObject



13
14
15
16
17
# File 'lib/generators/bootstrap/partial/partial_generator.rb', line 13

def generate_partial
  app = ::Rails.application
  ext = app.config.generators.options[:rails][:template_engine] || :erb
  copy_file "_#{component_name}.html.#{ext}", "app/views/shared/_#{component_name}.html.#{ext}"
end